From 5b6e4dc3ddc01fd1a40622d8e45f722cd7f84ca0 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Mon, 19 Mar 2012 11:31:39 +0100 Subject: [PATCH] Make it possible to prepend the autoloader. --- lib/Predis/Autoloader.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Predis/Autoloader.php b/lib/Predis/Autoloader.php index 091fdbb4..27006f1b 100644 --- a/lib/Predis/Autoloader.php +++ b/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); } /**