Revision 1938
Added by darkviper almost 11 years ago
Autoloader.php | ||
---|---|---|
12 | 12 |
/** |
13 | 13 |
* Autoloads Twig classes. |
14 | 14 |
* |
15 |
* @package twig |
|
16 |
* @author Fabien Potencier <fabien@symfony.com> |
|
15 |
* @author Fabien Potencier <fabien@symfony.com> |
|
17 | 16 |
*/ |
18 | 17 |
class Twig_Autoloader |
19 | 18 |
{ |
20 | 19 |
/** |
21 | 20 |
* Registers Twig_Autoloader as an SPL autoloader. |
21 |
* |
|
22 |
* @param Boolean $prepend Whether to prepend the autoloader or not. |
|
22 | 23 |
*/ |
23 |
public static function register() |
|
24 |
public static function register($prepend = false)
|
|
24 | 25 |
{ |
25 |
ini_set('unserialize_callback_func', 'spl_autoload_call'); |
|
26 |
spl_autoload_register(array(new self, 'autoload')); |
|
26 |
if (version_compare(phpversion(), '5.3.0', '>=')) { |
|
27 |
spl_autoload_register(array(new self, 'autoload'), true, $prepend); |
|
28 |
} else { |
|
29 |
spl_autoload_register(array(new self, 'autoload')); |
|
30 |
} |
|
27 | 31 |
} |
28 | 32 |
|
29 | 33 |
/** |
Also available in: Unified diff
update Twig template engine to version 1.13.1