Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Possible bug in smarty_core_assemble_plugin_filepath

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
alan
Smarty Regular


Joined: 17 Apr 2003
Posts: 43

PostPosted: Tue Sep 30, 2003 6:30 pm    Post subject: Possible bug in smarty_core_assemble_plugin_filepath Reply with quote

It appears that by having a plugin named the same as one of the built-in plugins (for example modifier.date_format.php) in order to override or extend some of its facilities does not work as expected in 2.6.0-RC1.

The smarty_core_assemble_plugin_filepath function, responsible for loading plugins, whilst it finds the appropriate plugin, does not immediately return, but instead continues to check ALL the plugin directories and uses the relevant plugin from the LAST matching directory.

This appears at first glance to be a waste of time, however it is only slowing down the compilation phase due to the caching of paths.

Initially I was confused by this as I was used to placing my own plugins directory before smarty's own directory, i.e.:

Code:
$plugins_dir = array('my_plugins', 'plugins');


which makes more sense to me in that this statement would appear to suggest that plugins would be taken from my_plugins folder in preference to the plugins folder.

The current workaround (at least without modifying the core code) is just to put my plugins folder AFTER smarty's. (although as I mentioned above, this does incur a slight speed penalty).
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Mon Oct 06, 2003 5:52 pm    Post subject: Reply with quote

this is the same as http://www.phpinsider.com/smarty-forum/viewtopic.php?p=5087#5087
and thus fixed in cvs.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs 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