Преглед изворни кода

Make it possible to prepend the autoloader.

Daniele Alessandri пре 13 година
родитељ
комит
7675bb040a
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      lib/Predis/Autoloader.php

+ 4 - 2
lib/Predis/Autoloader.php

@@ -35,10 +35,12 @@ class Autoloader
 
     /**
      * Registers the autoloader class with the PHP SPL autoloader.
+     *
+     * @param boolean $prepend Prepend the autoloader on the stack instead of appending it.
      */
-    public static function register()
+    public static function register($prepend = false)
     {
-        spl_autoload_register(array(new self, 'autoload'));
+        spl_autoload_register(array(new self, 'autoload'), true, $prepend);
     }
 
     /**