diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php index 733f039e9..dd45efc74 100644 --- a/libs/sysplugins/smarty_internal_debug.php +++ b/libs/sysplugins/smarty_internal_debug.php @@ -211,7 +211,7 @@ public function display_debug($obj, $full = false) // copy the working dirs from application $debObj->setCompileDir($smarty->getCompileDir()); // init properties by hand as user may have edited the original Smarty class - $debObj->setPluginsDir(is_dir(__DIR__ . '/../plugins') ? __DIR__ . '/../plugins' : $smarty->getPluginsDir()); + $debObj->setPluginsDir(is_dir(dirname(__FILE__) . '/../plugins') ? dirname(__FILE__) . '/../plugins' : $smarty->getPluginsDir()); $debObj->force_compile = false; $debObj->compile_check = Smarty::COMPILECHECK_ON; $debObj->left_delimiter = '{'; @@ -220,7 +220,7 @@ public function display_debug($obj, $full = false) $debObj->debugging = false; $debObj->debugging_ctrl = 'NONE'; $debObj->error_reporting = E_ALL & ~E_NOTICE; - $debObj->debug_tpl = isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . __DIR__ . '/../debug.tpl'; + $debObj->debug_tpl = isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . dirname(__FILE__) . '/../debug.tpl'; $debObj->registered_plugins = array(); $debObj->registered_resources = array(); $debObj->registered_filters = array(); diff --git a/utilities/BuildExpectedFiles.php b/utilities/BuildExpectedFiles.php index b6c368d87..b664d0c1a 100644 --- a/utilities/BuildExpectedFiles.php +++ b/utilities/BuildExpectedFiles.php @@ -6,7 +6,7 @@ * Time: 23:58 */ $sysplugins = array(); -$iterator = new DirectoryIterator(__DIR__ . '/../libs/sysplugins'); +$iterator = new DirectoryIterator(dirname(__FILE__) . '/../libs/sysplugins'); foreach ($iterator as $file) { if (!$file->isDot() && 'php' == $file->getExtension()) { $filename = $file->getBasename(); @@ -14,17 +14,17 @@ } } $plugins = array(); -$iterator = new DirectoryIterator(__DIR__ . '/../libs/plugins'); +$iterator = new DirectoryIterator(dirname(__FILE__) . '/../libs/plugins'); foreach ($iterator as $file) { if (!$file->isDot() && 'php' == $file->getExtension()) { $filename = $file->getBasename(); $plugins[ $filename ] = true; } } -$code = file_get_contents(__DIR__ . '/../libs/sysplugins/smarty_internal_testinstall.php'); +$code = file_get_contents(dirname(__FILE__) . '/../libs/sysplugins/smarty_internal_testinstall.php'); $expectedPlugins = '$expectedPlugins = ' . var_export($plugins, true); $code = preg_replace('#\$expectedPlugins =[^;]+#', $expectedPlugins, $code); $expectedSysplugins = '$expectedSysplugins = ' . var_export($sysplugins, true); $code = preg_replace('#\$expectedSysplugins =[^;]+#', $expectedSysplugins, $code); -file_put_contents(__DIR__ . '/../libs/sysplugins/smarty_internal_testinstall.php', $code); +file_put_contents(dirname(__FILE__) . '/../libs/sysplugins/smarty_internal_testinstall.php', $code);