/** * Initialize */ function init() { $CH = NyaaCache::current(); if (self::RELEASE === false || false === ($AppInfo = $CH->get('appinfo', $option))) { $AppInfo = unserialize(file_get_contents($this->Conf->rootDir . '/var/installed')); $CH->set('appinfo', $AppInfo); } $this->AppInfo = $AppInfo; // Get Current Application Name $this->set('env.app', $this->parseAppName($this->Request->getOr('app', $this->Conf->appDefault))); }
function __construct() { $this->mm = NyaaCache::current(); }
function loadMessage($file) { $CH = NyaaCache::current(); if (self::RELEASE === false || false === ($msg = $CH->get($file))) { $label = false; $buf = array(); $arr = array(); foreach (file($file) as $line) { $line = trim($line); if ($line == ".") { $arr[$label] = implode("\n", $buf); $buf = array(); $label = false; continue; } if ($label == false && $line[strlen($line) - 1] == ":") { $label = substr($line, 0, strlen($line) - 1); continue; } if ($label !== false) { $buf[] = $line; } } $msg = $arr; $CH->set($file, $msg); } $this->message = array_merge($this->message, $msg); }