* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium */ /** * Autoloader * * This class is included to allow for easy usage of Solarium. If you already * have your own autoloader that follows the Zend Framework class/file naming * you can use that to autoload Solarium (for instance Zend_Loader). * * @package Solarium */ class Solarium_Autoloader { /** * Register the Solarium autoloader * * The autoloader only acts for classnames that start with 'Solarium'. It * will be appended to any other autoloaders already registered. * * Using this autoloader will disable any existing __autoload function. If * you want to use multiple autoloaders please use spl_autoload_register. * * @static * @return void */ static public function register() { spl_autoload_register(array(new self, 'load')); } /** * Autoload a class * * This method is automatically called after registering this autoloader. * The autoloader only acts for classnames that start with 'Solarium'. * * @static * @param string $class * @return void */ static public function load($class) { if (substr($class, 0, 8) == 'Solarium') { $class = str_replace( array('Solarium', '_'), array('', '/'), $class ); $file = dirname(__FILE__) . '/' . $class . '.php'; require($file); } } }