Re: [SMARTY] Smarty-Light

From: Date: Thu, 15 Jul 2004 01:15:30 +0000
Subject: Re: [SMARTY] Smarty-Light
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11597@lists.php.net to get a copy of this message
--- Stefan <e.tuli@gmx.de> wrote: > > // call a static method to check for cached exemplars: > > $cache = SmartyBase::checkIfTemplateIsCached("nameOfTemplate"); > > i would hate it. ;o) While we are kicking ideas around, I've had a design in my head that focuses around the new Streams API. Filters and such are left to PHP land. Meanwhile, there would be separate stream wrappers for the main file types (template resources, compiled files, cache images) and you would subclass them to create your own resource handlers. Even display() becomes redundant--you'd use a standard PHP include() and/or get_file_contents for fetch(). I attempted a PHP4 prototype of this awhile back but I realized that several PHP5 only stream features are required to make a real go at it. FWIW, I used a callback metaphor to avoid the issue of making assignments (if a template is non-cached, it makes callbacks to get template assignments--otherwise it just reads the cache) but contexts would probably be better. I don't know how it would work out performance wise in the end, but I satisfied myself that it would at least be doable. Another thing about this design opportunity is that the compiler becomes more of a plugin--or possibly even a filter that can be applied to the stream. Concevievably you would be able to chain compilers (for example, to separate back-end and front-end). Evidently this decouples Smarty's internals making it more reasonable that someone might target specific slow portions and convert them either a C Stream Wrapper or C module. Well, that's just ideas and though they are PHP5 specific, they have nothing/little to do with the new object model. Monte's notion to start over with a reevaluation/design in the face of PHP5 makes sense to me. Perhaps we should move this to smarty-dev@lists.php.net? xo boots

« previous php.smarty.general (#11597) next »