src/Leevel/Kernel/Console/Autoload.php
protected function composerStaticClass(): string
    {
        static $staticClass;

        if ($staticClass) {
            return $staticClass;
        }

        $content = file_get_contents($this->app->path('vendor/autoload.php'));

        if (preg_match('/ComposerAutoloaderInit(\S{32})::getLoader/', $content, $matches)) {
            $staticContent = file_get_contents(
                $this->app->path('vendor/composer/autoload_static.php')
            );

            file_put_contents(
                $staticPath = $this->app->path('vendor/composer/ComposerStaticInit.php'),
                str_replace('ComposerStaticInit'.$matches[1], 'ComposerStaticInit', $staticContent)
            );

            $this->composerHash = $matches[1];

            include $staticPath;

            return $staticClass = '\\Composer\\Autoload\\ComposerStaticInit';
        }

        throw new InvalidArgumentException('Composer autoload is invalid.');
    }
protected function composerStaticClass(): string
    {
        static $staticClass;

        if ($staticClass) {
            return $staticClass;
        }

        $content = file_get_contents($this->app->path('vendor/autoload.php'));

        if (preg_match('/ComposerAutoloaderInit(\S{32})::getLoader/', $content, $matches)) {
            $staticContent = file_get_contents(
                $this->app->path('vendor/composer/autoload_static.php')
            );

            file_put_contents(
                $staticPath = $this->app->path('vendor/composer/ComposerStaticInit.php'),
                str_replace('ComposerStaticInit'.$matches[1], 'ComposerStaticInit', $staticContent)
            );

            $this->composerHash = $matches[1];

            include $staticPath;

            return $staticClass = '\\Composer\\Autoload\\ComposerStaticInit';
        }

        throw new InvalidArgumentException('Composer autoload is invalid.');
    }
取得 composer 静态类.

@return string