Neos\Flow\Core\Booting\Scripts::initializePackageManagement PHP Méthode

initializePackageManagement() public static méthode

Initializes the package system and loads the package configuration and settings provided by the packages.
public static initializePackageManagement ( Bootstrap $bootstrap ) : void
$bootstrap Neos\Flow\Core\Bootstrap
Résultat void
    public static function initializePackageManagement(Bootstrap $bootstrap)
    {
        $packageManager = new PackageManager();
        $bootstrap->setEarlyInstance(PackageManagerInterface::class, $packageManager);
        // The package:rescan must happen as early as possible, compiletime alone is not enough.
        if (isset($_SERVER['argv'][1]) && in_array($_SERVER['argv'][1], ['neos.flow:package:rescan', 'flow:package:rescan'])) {
            $packageManager->rescanPackages();
        }
        $packageManager->initialize($bootstrap);
        $bootstrap->getEarlyInstance(ClassLoader::class)->setPackages($packageManager->getActivePackages());
    }

Usage Example

Exemple #1
0
 /**
  * Bootstraps the minimal infrastructure, resolves a fitting request handler and
  * then passes control over to that request handler.
  *
  * @return void
  * @api
  */
 public function run()
 {
     Scripts::initializeClassLoader($this);
     Scripts::initializeSignalSlot($this);
     Scripts::initializePackageManagement($this);
     $this->activeRequestHandler = $this->resolveRequestHandler();
     $this->activeRequestHandler->handleRequest();
 }