Re: [SMARTY] plugins_dir in unstable release
| From: | Hinrich Donner | Date: | Tue, 04 Mar 2003 09:49:44 +0000 |
| Subject: | Re: [SMARTY] plugins_dir in unstable release | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8373@lists.php.net to get a copy of this message | ||
On Tuesday 04 March 2003 00:14, Juzan Jean-Michel wrote:
> But seems not work, I have no error but for example string_format have
> no effect, seems the plugin it's not load
Funny. I have this source, and it works proper:
[cut]
// Adjust the plugin directories
//
$plugins_dir = array("{$root_path}/lib/smarty/plugins/",
"{$root_path}/includes/plugins/");
// Get possible plugins
//
$modules =& new tisModules();
foreach ($modules->getArrayReference() as $module)
{
$path =
"{$root_path}/modules/".tisVarPrepForOS($module->getName()).'/plugins';
if ($module->isActive()
&& file_exists($path)
&& @is_dir($path))
$plugins_dir[] = "{$path}/";
}
$this->plugins_dir = $plugins_dir;
[/cut]
$root_path ist the absolute path to the web-root, $modules is a list of
objects with the installed modules, $module is an object with module
information. The name is equal to its directory. tisVarPrepForOS() just
remove illegal characters from the names if any.
The source is located in the constructor of my class, which is a child of
Smarty. parent::Smarty is called first.
Hinrich
--
Hinrich Donner