Re: plugin interface

From: Date: Wed, 10 Oct 2001 14:24:07 +0000
Subject: Re: plugin interface
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1663@lists.php.net to get a copy of this message
Anders Janson wrote: > > > > > * must stat() plugin directory file for each plugin called in templates, > > may be a performance issue? maybe we can put "core" plugins in one file > > to alleviate this (leave in addons file) > > Personally, I could accept some minor compile time performance issues, > since I almost always will test my templates (=compile them) myself. > Compiled templates should only have the "include" statement compiled into > them. > And if you put all "core" plugins in one file, then what have we won? It's > just as good/bad as the addon file today. It's all or nothing. If we have "core" functions in one file (the commonly used ones), we wouldn't need to stat() the plugin directory and include them for each invocation of Smarty. For lesser used functions or contributed functions from other users, we could drop these into the plugin directory with no overhead to Smarty. Another idea would be to compile plugins. So we could put ALL functions and modifiers in the plugins directory, then the "addons" script would go away, and plugins get compiled and placed into the templates_c directory when you first load Smarty. After the first run, then Smarty would include this file each time. There are some issues to think about here... do we compile every plugin available, or do we compile each one as they are mentioned in the templates? If the latter, some more thought needs to go into that. > > > > > > > Q's: > > * do we keep function/modifier registration around for backward > > compatability? If so, it will be added to above steps. > > Keep the registration for a while, at least as dummy entries. Make it very > clear in the documentation that these functions will be gone in some future > version. If you decide to skip registration, that is! I really hate > compatibility breakers ;) We could leave the registration functionality in Smarty and make it empty in the distribution. Then in the documentation, make it absolutely clear that plugins are the preferred method of adding functionality to Smarty. -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

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