/** * 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); }
* Handle automatic updating */ $cms->handleAutomaticUpdates(); /** * ---------------------------------------------------------------------------- * Now that we have languages out of the way, we can run our package on_start * methods * ---------------------------------------------------------------------------- */ $cms->setupPackages(); /** * ---------------------------------------------------------------------------- * Load all permission keys into our local cache. * ---------------------------------------------------------------------------- */ PermissionKey::loadAll(); /** * ---------------------------------------------------------------------------- * Fire an event for intercepting the dispatch * ---------------------------------------------------------------------------- */ \Events::dispatch('on_before_dispatch'); /** * ---------------------------------------------------------------------------- * Get the response to the current request * ---------------------------------------------------------------------------- */ $response = $cms->dispatch($request); /** * ---------------------------------------------------------------------------- * Send it to the user
public function setPermissionKeyHasCustomClass($pkHasCustomClass) { $db = Loader::db(); $db->Execute('update PermissionKeys set pkHasCustomClass = ? where pkID = ?', array(intval($pkHasCustomClass), $this->getPermissionKeyID())); Key::loadAll(); }