Added support for autoload $prepend

This commit is contained in:
Martin Hasoň 2014-02-12 14:06:32 +01:00 committed by nikic
parent 91f6880734
commit 2605b8319e

View File

@ -9,10 +9,12 @@ class Autoloader
{
/**
* Registers PhpParser\Autoloader as an SPL autoloader.
*
* @param bool $prepend Whether to prepend the autoloader instead of appending
*/
static public function register() {
static public function register($prepend = false) {
ini_set('unserialize_callback_func', 'spl_autoload_call');
spl_autoload_register(array(__CLASS__, 'autoload'));
spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
}
/**