Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty in C++

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
Enquest
Smarty Regular


Joined: 14 May 2003
Posts: 79

PostPosted: Wed Nov 05, 2003 12:46 pm    Post subject: Smarty in C++ Reply with quote

I don't know if you people do know this. But maybe its intresting to have a look at the following discussion. http://www.phpfreaks.com/forums/viewtopic.php?p=38006#38006

Somebody embarked to make smarty in C or C++
_________________
-----------------------
Learning my self by trying to help others
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Nov 14, 2003 11:21 pm    Post subject: Reply with quote

i looked at it but i'm missing the relation to smarty.

it merely does:

Code:
        $source = implode(file($this->template_dir . '/' . $template));
        echo preg_replace('!\{\$(.*)\}!Ue', '$this->_tpl_vars[\'$1\']', $source);


of course it does it faster than my snippet above and it does anything anyway faster than smarty does, but it does nothing else.

the niche where people need a c-extension to solve the above problem is very thin IMHO.

i wouldn't mind if smarty's compiler was 3 times slower (it is only called once anyway) but there is merit to get smarty going as an extension (for the things that are called thousands of times):

except of the load-time of the .php-file there are at least two execution-paths that are worth being accelerated by native code:

- the call to display() and anything below that if a compiled template is found

- the call to display() and anything below if a cached file is found.


there is this outline about what smarty is:
http://news.php.net/article.php?group=php.template&article=531

it has it's age, but it still reflects what smarty is about and where it belongs.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP