public function hookUserAuthorization() { $user = Reg::get($this->config->Objects->UserAuthorization)->getUserFromRequest(); if (is_a($user, "User")) { Reg::register($this->config->ObjectsIgnored->User, $user); } }
/** * Call other controller with given URI. * Can be used to call different controller using some logic. * WARNING! All GET parameters are being lost upon redirection. * * @param string $uri */ function redirectController($uri) { $_SERVER['REQUEST_URI'] = SITE_PATH . $uri; $_GET = array(); if (Reg::get('packageMgr')->isPluginLoaded("RewriteURL", "RewriteURL")) { Reg::get(ConfigManager::getConfig("RewriteURL", "RewriteURL")->Objects->rewriteURL)->parseURL(); } $newNav = Reg::get(ConfigManager::getConfig("SiteNavigation", "SiteNavigation")->Objects->RequestParser)->parse(); Reg::register(ConfigManager::getConfig("SiteNavigation", "SiteNavigation")->ObjectsIgnored->Nav, $newNav, true); Reg::get(ConfigManager::getConfig("SiteNavigation", "SiteNavigation")->Objects->Controller)->exec(); }
require_once STINGLE_PATH . "core/Model.class.php"; require_once STINGLE_PATH . "core/PackageManager.class.php"; require_once STINGLE_PATH . "core/Reg.class.php"; require_once STINGLE_PATH . "core/SiteMode.class.php"; require_once STINGLE_PATH . "core/Exceptions/EmptyArgumentException.class.php"; require_once STINGLE_PATH . "core/Exceptions/InvalidArrayArgumentException.class.php"; require_once STINGLE_PATH . "core/Exceptions/InvalidIntegerArgumentException.class.php"; require_once STINGLE_PATH . "core/Exceptions/InvalidTimestampArgumentException.class.php"; require_once STINGLE_PATH . "functions/system.php"; require_once STINGLE_PATH . "functions/func.php"; register_shutdown_function("shutdown"); set_exception_handler("default_exception_handler"); set_error_handler(create_function('$severity, $message, $file, $line', 'throw new ErrorException($message, $severity, $severity, $file, $line);')); $config = new Config($CONFIG); ConfigManager::setGlobalConfig($config); Reg::register('packageMgr', new PackageManager()); error_reporting($config->site->error_reporting); session_name($config->site->site_id); session_start(); ob_start('stingleOutputHandler'); Cgi::setMode(defined("IS_CGI")); Debug::setMode($config->Debug->enabled); SiteMode::set($config->SiteMode->mode); // Register User Hooks if (isset($config->Hooks)) { foreach (get_object_vars($config->Hooks) as $hookName => $funcName) { if (is_object($funcName)) { foreach (get_object_vars($funcName) as $regFuncName) { HookManager::registerHook(new Hook($hookName, $regFuncName)); } } else {
public function hookParse() { Reg::register($this->config->ObjectsIgnored->Nav, $this->requestParser->parse()); }
/** * Register initialized object in Reg (Registry) * with name specified in config's * "Objects" section * * @param mixed $object * @throws RuntimeException */ protected function register($object) { $backtrace = debug_backtrace(); $loadFunction = $backtrace[1]['function']; if (substr($loadFunction, 0, 4) != 'load') { throw new RuntimeException("Called register function not from one of the loader's load object functions!"); } $objectNameToRegister = substr($loadFunction, 4); $registerName = $this->config->Objects->{$objectNameToRegister}; Reg::register($registerName, $object); }
public function hookGetLanguageObj() { Reg::register($this->config->ObjectsIgnored->Language, Reg::get($this->config->Objects->LanguageManager)->getLanguage()); }
public function hookUserAuthorization() { Reg::register($this->config->ObjectsIgnored->User, Reg::get($this->config->Objects->UserAuthorization)->getUserFromRequest()); }