Ejemplo n.º 1
0
 /**
  * Begin the runtime.
  */
 public function run()
 {
     $app = $this->app;
     include DIR_APPLICATION . '/bootstrap/app.php';
     if ($this->app->isInstalled()) {
         /*
          * ----------------------------------------------------------------------------
          * Now that we have languages out of the way, we can run our package on_start
          * methods
          * ----------------------------------------------------------------------------
          */
         $app->setupPackages();
         /*
          * ----------------------------------------------------------------------------
          * Legacy Definitions. This has to come after packages because this
          * essentially loads the entity manager, and the entity manager loads classes
          * found in its config, which may be classes that haven't been autoloaded by initialPackages. It also
          * has to come after setupPackages() in case an autoloader is configured in on_start()
          * ----------------------------------------------------------------------------
          */
         $this->initializeLegacyURLDefinitions($app);
         /*
          * Handle automatic updating. Must come after setupPackages() because some things setup autoloaders in on_start() of their package
          * controller
          */
         $app->handleAutomaticUpdates();
         // This is a crappy place for this, but it has to come AFTER the packages because sometimes packages
         // want to replace legacy "tools" URLs with the new MVC, and the tools paths are so greedy they don't
         // work unless they come at the end.
         $this->registerLegacyRoutes();
         /* ----------------------------------------------------------------------------
          * Register legacy routes
          * ----------------------------------------------------------------------------
          */
         $this->registerLegacyRoutes();
         /* ----------------------------------------------------------------------------
          * Register legacy config values
          * ----------------------------------------------------------------------------
          */
         $this->registerLegacyConfigValues();
         /*
          * ----------------------------------------------------------------------------
          * Load all permission keys into our local cache.
          * ----------------------------------------------------------------------------
          */
         Key::loadAll();
     }
     /*
      * ----------------------------------------------------------------------------
      * Fire an event for intercepting the dispatch
      * ----------------------------------------------------------------------------
      */
     Events::dispatch('on_before_dispatch');
     $request = Request::createFromGlobals();
     return $this->server->handleRequest($request);
 }
Ejemplo n.º 2
0
 public function on_start()
 {
     Events::addListener('on_before_render', function () {
         $c = Page::getCurrentPage();
         if (is_object($c) && $c->isEditMode()) {
             $view = View::getInstance();
             $html = new Html();
             $view->addHeaderItem($html->css('area_hints.css', 'area_hints'));
         }
     });
 }
 /**
  * On CMS boot.
  *
  * @return void
  */
 public function on_start()
 {
     $this->registerAssets();
     Events::addListener('on_before_render', function ($e) {
         $c = Page::getCurrentPage();
         if ($c instanceof Page) {
             $r = ResponseAssetGroup::get();
             if (!$c->isEditMode()) {
                 $r->requireAsset('smooth-scrolling');
             }
         }
     });
 }
 public function register()
 {
     /** @var Repository $config */
     $config = $this->app['config'];
     $namespaces = $config->getNamespaces();
     if (!isset($namespaces['documentation_generator'])) {
         $config->addNamespace('documentation_generator', realpath(__DIR__ . "/../config"));
     }
     $obj = $this;
     \Concrete\Core\Support\Facade\Events::addListener('on_before_console_run', function () use($obj) {
         $provider_list = new ConsoleProviderList(\Core::getFacadeApplication(), \Core::make('console'));
         $provider_list->registerProvider('\\Concrete\\DocumentationGenerator\\Console\\ServiceProvider');
         $obj->registerCommentRepositoryFactory();
     });
 }