mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
Update lib/Twig/Autoloader.php
Added the ability to register the autoloader at the top of the stack, useful in some situations.
This commit is contained in:
@@ -19,11 +19,15 @@ class Twig_Autoloader
|
||||
{
|
||||
/**
|
||||
* Registers Twig_Autoloader as an SPL autoloader.
|
||||
*
|
||||
* @param boolean $prepend (optional) Whether to add the autoloader to
|
||||
* the start of the stack. Defaults to false so the autoloader will be
|
||||
* appended to the stack.
|
||||
*/
|
||||
public static function register()
|
||||
public static function register($prepend = false)
|
||||
{
|
||||
ini_set('unserialize_callback_func', 'spl_autoload_call');
|
||||
spl_autoload_register(array(new self, 'autoload'));
|
||||
spl_autoload_register(array(new self, 'autoload'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user