Пример #1
0
 /**
  * Register all addons.
  */
 public function register()
 {
     $enabled = $this->getEnabledAddonNamespaces();
     $installed = $this->getInstalledAddonNamespaces();
     $paths = $this->paths->all();
     /**
      * First load all the addons
      * so they're available.
      */
     foreach ($paths as $path) {
         $this->loader->load($path);
     }
     $this->loader->register();
     /**
      * Then register all of the addons now
      * that they're all PSR autoloaded.
      */
     foreach ($paths as $path) {
         $this->integrator->register($path, $enabled, $installed);
     }
     // Sort all addons.
     $this->addons = $this->addons->sort();
     /**
      * Disperse addons to their
      * respective collections and
      * finish the integration service.
      */
     $this->addons->disperse();
     $this->addons->registered();
     $this->integrator->finish();
     $this->dispatcher->fire(new AddonsHaveRegistered($this->addons));
 }