Base::autoload PHP Method

autoload() protected method

Namespace-aware class autoloader
protected autoload ( $class ) : mixed
$class string
return mixed
    protected function autoload($class)
    {
        $class = $this->fixslashes(ltrim($class, '\\'));
        $func = NULL;
        if (is_array($path = $this->hive['AUTOLOAD']) && isset($path[1]) && is_callable($path[1])) {
            list($path, $func) = $path;
        }
        foreach ($this->split($this->hive['PLUGINS'] . ';' . $path) as $auto) {
            if ($func && is_file($file = $func($auto . $class) . '.php') || is_file($file = $auto . $class . '.php') || is_file($file = $auto . strtolower($class) . '.php') || is_file($file = strtolower($auto . $class) . '.php')) {
                return require $file;
            }
        }
    }

Usage Example

Esempio n. 1
0
 function __autoload($class)
 {
     return Base::autoload($class);
 }
All Usage Examples Of Base::autoload