|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
m-g Smarty Rookie
Joined: 12 Jan 2010 Posts: 6 Location: Germany
|
Posted: Tue Jan 12, 2010 12:49 pm Post subject: Error: Beta6: _get_plugin_filepath |
|
|
I am using some additional Smarty plugins (e.g. imagetext, ...). With Smarty2 all works fine, but after upgrading and testing with Smarty3 beta 6 I got:
Exception: Undefined Smarty method "_get_plugin_filepath"
due to the following line:
require_once $smarty->_get_plugin_filepath('shared','imagetext');
Is there anything to adjust? Or is this obsolete and the plugin needs a rewrite? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jan 12, 2010 3:24 pm Post subject: |
|
|
If the plugin uses anything internal to Smarty 2, it likely will not work with Smarty 3 without some adjustments. |
|
Back to top |
|
m-g Smarty Rookie
Joined: 12 Jan 2010 Posts: 6 Location: Germany
|
Posted: Mon Jan 18, 2010 8:23 am Post subject: |
|
|
Here a solution to get "_get_plugin_filepath" running with v2 and v3:
Code: |
if (method_exists($smarty, '_get_plugin_filepath')) {
//handle with Smarty version 2
require_once $smarty->_get_plugin_filepath('shared','imagetext');
} else {
//handle with Smarty version 3
foreach ($smarty->getpluginsdir($smarty) as $value) {
$filepath = $value ."/shared.imagetext.php";
if (file_exists($filepath)) {
require_once $filepath;
}
}
}
|
|
|
Back to top |
|
m-g Smarty Rookie
Joined: 12 Jan 2010 Posts: 6 Location: Germany
|
Posted: Fri Mar 05, 2010 5:40 pm Post subject: now ready for Smarty Beta 8 |
|
|
Because
Quote: | $smarty->getpluginsdir($smarty) |
is no longer available in Smarty 3 Beta 8, the plugin must be changed again:
Code: |
if (method_exists($smarty, '_get_plugin_filepath')) {
//handle with Smarty version 2
require_once $smarty->_get_plugin_filepath('shared','imagetext');
} else {
//handle with Smarty version 3 beta 8
foreach ($smarty->plugins_dir as $value) {
$filepath = $value ."/shared.imagetext.php";
if (file_exists($filepath)) {
require_once $filepath;
}
}
}
|
Or fell free to download the new version from sourceforge https://sourceforge.net/projects/imagetext/ |
|
Back to top |
|
|
|
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
|