Browse Source

Allow the Composer ClassLoader to be unregistered easily

Jordi Boggiano 13 years ago
parent
commit
8c535b1961
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/Composer/Autoload/ClassLoader.php

+ 8 - 0
src/Composer/Autoload/ClassLoader.php

@@ -84,6 +84,14 @@ class ClassLoader
         spl_autoload_register(array($this, 'loadClass'), true, $prepend);
     }
 
+    /**
+     * Unregisters this instance as an autoloader.
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+    }
+
     /**
      * Loads the given class or interface.
      *