Re[2]: [SMARTY-GENERAL] Plugindir
| From: | Linus McCabe | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re[2]: [SMARTY-GENERAL] Plugindir | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3585@lists.php.net to get a copy of this message | ||
afaik the only scanning needed is for pre/post and output filters, so to
save compilation time I'd suggest they'd only be allowed in one dir (perhaps
the first one specified?)
Also, if the filters were kept in another dir than the rest of the plugins scanning
would be even faster. (I assume you only have a few filterplugins per site,
whereas other plugins could be hundreds after a while...)
Maybe instead of several plugindirs subdirs would be an option:
{myPlugin type="funny"}
and smarty would load it from pluginsdir/funny rather than pluginsdir/
/linus
On Tue, 9 Apr 2002 14:43:12 -0500 Andrei Zmievski <andrei@ispi.net> wrote:
> 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
>
>
>