- revert autoloader optimizations because of unexplainable warning when using plugins https://github.com/smarty-php/smarty/issues/199

This commit is contained in:
uwetews
2016-03-02 18:17:22 +01:00
parent b99bc7b8da
commit 4f5aeeb2b6
2 changed files with 12 additions and 26 deletions

View File

@@ -1,4 +1,7 @@
 ===== 3.1.30-dev ===== (xx.xx.xx)
02.03.2016
- revert autoloader optimizations because of unexplainable warning when using plugins https://github.com/smarty-php/smarty/issues/199
01.03.2016
- bugfix template objects must be cached on $smarty->fetch('foo.tpl) calls incase the template is fetched
multiple times (forum topic 25909)

View File

@@ -90,34 +90,17 @@ class Smarty_Autoloader
public static function autoload($class)
{
$_class = strtolower($class);
if (strpos($_class, 'smarty') !== 0) {
return;
}
$file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
if (strpos($_class, 'smarty_internal_') === 0) {
if (strpos($_class, 'smarty_internal_compile_') === 0) {
if (is_file($file)) {
require $file;
}
return;
}
@include $file;
return;
}
if (preg_match('/^(smarty_(((template_(source|config|cache|compiled|resource_base))|((cached|compiled)?resource)|(variable|security)))|(smarty(bc)?)$)/',
$_class, $match)) {
if (!empty($match[ 3 ])) {
@include $file;
return;
} elseif (!empty($match[ 9 ]) && isset(self::$rootClasses[ $_class ])) {
$file = self::$rootClasses[ $_class ];
require $file;
return;
}
}
if (0 !== strpos($_class, 'smarty')) {
return;
}
if (is_file($file)) {
require $file;
return;
include $file;
} else if (isset(self::$rootClasses[ $_class ])) {
$file = self::$SMARTY_SYSPLUGINS_DIR . self::$rootClasses[ $_class ] . '.php';
if (is_file($file)) {
include $file;
}
}
return;
}