Re: [SMARTY-GENERAL] Plugindir

From: Date: Tue, 09 Apr 2002 19:43:12 +0000
Subject: Re: [SMARTY-GENERAL] Plugindir
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3581@lists.php.net to get a copy of this message
On Sun, 07 Apr 2002, Linus McCabe wrote: > I'd suggest: > Have two plugins dirs in smarty. > One that is distributed with smarty that contains all the standard plugins. > One that is user specified that contains 'private' plugins and filters. > > The user-specified pluginsdir is searched first, so that the user can > override smarty standard plugins. > The user specified pluginsdir is the only one scanned for pre/post filters > (as I figure these kind of filters are always applied and therefore quite > site-specific?) > > This way, on a server with multiple sites only one smarty installation is > needed, standard plugins needs only to be installed in one dir and site > specific plugins/filters can easily be used and distributed with 3rd party > applications (without the need of registering every plugin-function). > > Hope this made some kind of sence :) If we go that way, I would actually like to have more than two plugin directories, otherwise we'll once again have someone complaining that two directories is not enough. But it has some consequences: 1. The default Smarty plugin directory needs to be specified first in the list, for a number of reasons. One of which is performance: if the default dir is searched first, then Smarty doesn't have to do as much work looking through the other ones. 2. The plugin directories will have to be relative to the dir where Smarty is installed or absolute paths. 3. Pre/postfilters. Not quite sure what to do about those, since scanning all the plugin directories might be a bit costly, but then it's only done during compilation. However, if we introduce 'output' plugins then those will incur a performance penalty because they will need to be located upon every template access, unless the output plugins are specifie via something like {output type="trimwhitespace"}. -Andrei "Music expresses that which can not be said and on which it is impossible to be silent." -Victor Hugo

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