I'm open to any advice to help improve this code for general use.    /**** This code was created by Joshua Getner.* @license http://opensource.org/licenses/bsd-license.php BSD* **/namespace Blacksmith;class Autoloader{    // an array that maps classnames to there filepaths    protected static $classes = array();   /**    * register your classnames and class paths to the autoloader.    * keeps the loading quick and accurate.    * @param string $class    * @param string $path    * @return null    */    public static function setClassPath($className, $path)    {        static::$classes[$className] = str_replace('\\' , '/' , $path);    }   /**    * register an array of classname with paths to the file    * keeps the loading quick and accurate.    * @param array $classes    * @return null    */    public static function setClassPaths(array $classes)    {        static::$classes = array_merge($classes, static::$classes);    }   /**    * return the path to the classname registered.    * @param string $class    * @return string    */    public static function getClassPath($className)    {        return((isset(static::$classes[$className]) ?             static::$classes[$className] : false));    }   /**    * return the array of all the classes registered.    * @return array    */    public static function getClassPaths()    {        return static::$classes;    }   /**    * return a formated file path according to the PSR standard    * @param string $class    * @return string    */    public static function formatPSRClass($class)    {        return  str_replace(array('\\', '_'), '/', strtolower($class)) . '.php';    }      /**    * attempt to load the registered class or interface.    * @param string $class    * @return bool    */    public static function loadClass($class)    {        $path = ;        // check if the class has been mapped        if(static::getClassPath($class) !== false)        {            // set the path as the mapped path            $path = static::getClassPath($class);        }        // so no class mapped, lets try the PSR way        else        {            // get the path from the class name according to PSR-0            $path = str_replace('\\', '/', dirname(__FILE__)) . '/' . static::formatPSRClass($class);        }        // lets attempt to load the file and check if the class or interface exists         if(file_exists($path))        {            @require $path;            if(class_exists($class, false) || interface_exists($class , false))            {                return true;            }        }        // throw an exception no class was loaded.        else        {            throw new \Exception(sprintf('unable to load the requested class: %s at path %s', $class, $path));        }    }}
autoloader class fine tune to be usable in every project
php;object oriented;classes