28 private static function init() {
45 public static function main() {
47 define(
'NYROVERSION',
'0.2');
49 $globalContent = null;
52 $cacheInstVars = null;
58 self::$cfg->overload(__CLASS__.
'Response');
60 if (self::$cfg->globalCache && !
request::isPost() && count($_GET) == 0 && $resp->canGlobalCache()) {
61 $prm = is_array(self::$cfg->globalCache) ? self::$cfg->globalCache : array();
63 $id = str_replace(
'/',
'._.',
'/'.
request::get(
'request')).(request::isAjax() ?
'-ajax' :
'');
64 $cacheInst->get($globalContent, array(
68 $cacheInstVars->get($globalVars, array(
72 if (is_null($globalContent)) {
81 session::setFlash(
'nyroError',
'MODULE or ACTION NOT FOUND<br />'.self::handleError($e));
82 $resp->error(null, 404);
85 $resp->error(null, 500);
86 }
catch (PDOException $e) {
88 $resp->error(null, 500);
89 }
catch (Exception $e) {
91 $resp->error(null, 500);
99 $resp->setVarsFromGlobalCache($globalVars);
102 $globalVars = $resp->getVarsForGlobalCache();
103 $globalContent = $resp->send();
105 $cacheInstVars->save();
111 }
catch (Exception $e) {
123 if (self::$cfg && self::$cfg->check($name))
124 return self::$cfg->get($name);
static getInstance(array $cfg=array())
static getGlobalCfg($name)
static setFlash($name, $val=null)
static loadCfg($className, $searchParent=true)
static handleError(Exception $err)
static trace($obj, $printExit=false)