Boot 依次调用类里面的_init开头的方法

@param $className
@return bool
14059
public static function boot($className)
    {
        if (!class_exists($className)) {
            return false;
        }

        $bootstrap = new $className;
        $dispatcher = Dispatcher::getInstance();

        $class = new \ReflectionClass($className);
        foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
            $methodName = $method->name;
            if (!$method->isStatic() && substr_compare('_init', $methodName, 0, 5) === 0) {
                $bootstrap->$methodName($dispatcher);
            }
        }

        return true;
    }
242539
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Web\\UserInterface\\Frontend\\FrontendHelper':
                return $this->framework->initiateObject($className, array(), true);
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
526665
protected static function boot()
    {
        $class = get_called_class();

        static::$mutatorCache[$class] = array();

        foreach (get_class_methods($class) as $method) {
            if (preg_match('/^get(.+)Attribute$/', $method, $matches)) {
                if (static::$snakeAttributes) $matches[1] = Str::snake($matches[1]);

                static::$mutatorCache[$class][] = lcfirst($matches[1]);
            }
        }

        static::bootTraits();
    }
522475
private function _generateDispatchFile($className)
    {
        $file = '@' . str_replace('\\', '/', ltrim($className, '\\')) . '.php';
        $file = str_replace('\\', DIRECTORY_SEPARATOR, Yii::getAlias($file));
        throw new Exception("请在该路径下创建调度器文件:\r\n{$file}");
    }
587125
public function load($className)
    {
        // get namespace from className
        $namespace = substr($className, 0, strlen($this->namespace.$this->namespaceSeparator));

        // check if requested class must be loaded by this instance of loader
        if ($this->namespace === null || $this->namespace.$this->namespaceSeparator === $namespace) {
            $fileName  = '';
            $namespace = '';

            if (($lastNsPos = strripos($className, $this->namespaceSeparator)) !== false) {
                $namespace = substr($className, 0, $lastNsPos);
                $className = substr($className, $lastNsPos + 1);
                $fileName  = str_replace($this->namespaceSeparator, $this->separator, $namespace).$this->separator;
            }

            $fileName .= str_replace('_', $this->separator, $className).$this->fileExtension;

            if ($this->includePath !== null) {
                $fileName = $this->includePath.$this->separator.$fileName;
            }

            // check first if file exists and load it -> @... suppress is fasted solution ;)
            @include_once $fileName;
        }
    }
832180
public function loadClass($className)
    {
        if ($filePath = $this->resolveFileName($className)) {
            if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
                if ($this->classFileExists($filePath)) {
                    require_once $filePath;
                }
            } else {
                require_once $filePath;
            }
        }
    }
293870
public function request($classname)
    {
        $instance = $this->instance($classname);
        return ($instance != null ? $instance->request() : null);
    }
969143
public function hasClass($className)
    {
        if ($this->hasAttribute('class')) {
            return in_array($className, preg_split('/\s+/', $this->getAttribute('class')));
        }

        return false;
    }
889375
public function loadClass($className) {
        $classFound = $this->composerClassLoader->loadClass($className);
        if (!$classFound && !$this->caseSensitiveClassLoading) {
            $classFound = $this->composerClassLoader->loadClass(strtolower($className));
        }
        return $classFound;
    }
783067
static public function autoload($className)
    {
        $className = ltrim($className, '\\');
        $fileName  = '';
        $namespace = '';
        if ($lastNsPos = strripos($className, '\\')) {
            $namespace = substr($className, 0, $lastNsPos);
            $className = substr($className, $lastNsPos + 1);
            $fileName  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
        }
        $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

        require self::$base . $fileName;
    }
333195
public function load($className)
    {
        $class = ltrim($className, '\\');

        if (strpos($class, $this->namespace) !== 0) {
            return false;
        }

        $nsparts   = explode('\\', $class);
        $class     = array_pop($nsparts);
        $nsparts[] = '';
        $path      = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts);
        $path     .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';

        if (!is_readable($path)) {
            return false;
        }

        require $path;

        return class_exists($className,false);
    }
1320788
public static function instantiate($className)
    {
        $objectManager = self::get()->getObjectManager();
        $args = func_get_args();

        if (1 === count($args)) {
            return $objectManager->get($className);
        }

        return call_user_func_array([$objectManager, 'get'], $args);
    }
1321689
public static function getConfigInjects($className)
    {
        // 配置文件注入
        $beanData = BeanParser::getInstance()->getData();
        if(isset($beanData[$className]))
        {
            $beanName = $beanData[$className]['beanName'];
        }
        else
        {
            $beanName = $className;
        }

        $beanProperties = null;
        // 优先从服务器bean配置获取
        try{
            $beanProperties = Config::get('@server.' . RequestContext::getServer()->getName() . '.beans.' . $beanName, null);
        }
        catch(\Throwable $ex)
        {
            $beanProperties = null;
        }
        // 全局bean配置
        if(null === $beanProperties)
        {
            $beanProperties = Config::get('@app.beans.' . $beanName, []);
        }
        return $beanProperties ?? [];
    }
812519
public function autoload ($classname) {
        // if the class where already loaded. should not happen
        if (class_exists($classname)) {
            return TRUE;
        }

        // Works for PEAR style class names and namespaced class names
        $path = str_replace(
            array('_', '\\'),
            '/',
            $classname
        ) . '.php';
        
        foreach ($this->paths as $basePath) {
            $tail = $path;
            if (!is_string($basePath)) {
                $namespace = $basePath[1];
                $basePath = $basePath[0];
                $tail = str_replace($namespace . '/', '', $tail);
            }
            if (file_exists($basePath . '/' . $tail)) {
                include_once $basePath . '/' . $tail;
                return TRUE;
            }
        }
        // @codeCoverageIgnoreStart
        // returning false makes PHP throwing a fatal error
        return FALSE;
        // @codeCoverageIgnoreEnd
    }
28301
public function loadClass($className)
    {
        if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
            return false;
        }

        require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
               . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className)
               . $this->fileExtension;

        return true;
    }
86902
public function isInstanceOf($className)
    {
        $this->doCheck(function ($value) use ($className) {
            $this->throwExceptionIfFalse(
                $value instanceof $className,
                'Failed assertion that %s is an instance of %s', $value, $className
            );
        });

        return $this;
    }
921085
public function load($className)
    {
        if (isset($this->_classes[$className])) {
            $file = $this->_classes[$className];
            if (!is_file($file)) {
                trigger_error(strtr('load `:class` class failed: `:file` is not exists.', [':class' => $className, ':file' => $file]), E_USER_ERROR);
            }

            //either linux or phar://
            if (PHP_EOL === "\n" || $file[0] === 'p') {
                /** @noinspection PhpIncludeInspection */
                require $file;
            } else {
                $this->requireFile($file);
            }

            return true;
        }

        /** @noinspection LoopWhichDoesNotLoopInspection */
        foreach ($this->_namespaces as $namespace => $path) {
            if (strpos($className, $namespace) !== 0) {
                continue;
            }

            $file = $path . strtr(substr($className, strlen($namespace)), '\\', '/') . '.php';
            if (is_file($file)) {
                //either linux or phar://
                if (PHP_EOL === "\n" || $file[0] === 'p') {
                    /** @noinspection PhpIncludeInspection */
                    require $file;
                } else {
                    $this->requireFile($file);
                }

                return true;
            }
        }

        return false;
    }