fixed the autoloader for PHP 5.2

This commit is contained in:
Fabien Potencier
2013-05-01 08:42:32 +02:00
parent a20a46ab4a
commit eaf5a2db54
+5 -1
View File
@@ -23,7 +23,11 @@ class Twig_Autoloader
*/
public static function register($prepend = false)
{
spl_autoload_register(array(new self, 'autoload'), true, $prepend);
if (version_compare(phpversion(), '5.3.0', '>=')) {
spl_autoload_register(array(new self, 'autoload'), true, $prepend);
} else {
spl_autoload_register(array(new self, 'autoload'));
}
}
/**