Размер файла: 988B
<?php
/**
* cvServiceContainerAutoloader
*
* @package CYBERVILLE
* @subpackage DI
* @author Fabien Potencier <[email protected]>
* Kochergin Nick <[email protected]>, <http://cyberville-project.ru>
* @version $Id$
*/
class cvServiceContainerAutoloader {
/**
* Registers cvServiceContainerAutoloader as an SPL autoloader.
*/
static public function register() {
ini_set('unserialize_callback_func', 'spl_autoload_call');
spl_autoload_register(array(new self, 'autoload'));
}
/**
* Handles autoloading of classes.
*
* @param string $class A class name.
*
* @return boolean Returns true if the class has been loaded
*/
public function autoload($class) {
if (0 !== strpos($class, 'cvService')) {
return false;
}
require dirname(__FILE__) . '/' . $class . '.php';
return true;
}
}
?>