/** * @return ICacheJournal */ protected function getJournal() { return $this->context->getService('Nette\\Caching\\ICacheJournal'); }
/** * Get initial instance of context. * @return IContext */ public function createContext() { $context = new Context; foreach ($this->defaultServices as $name => $service) { $context->addService($name, $service); } return $context; }
/** * @return Nette\Caching\ICacheStorage */ public static function createCacheStorage() { $context = new Context(); $context->addService('Nette\\Caching\\ICacheJournal', array(__CLASS__, 'createCacheJournal')); $dir = Environment::getVariable('tempDir') . '/cache'; umask(00); @mkdir($dir, 0755); // @ - directory may exists return new Nette\Caching\FileStorage($dir, $context); }
/** * @return Nette\Web\Session */ protected function getSession($namespace = NULL) { $handler = $this->context->getService('Nette\\Web\\Session'); return $namespace === NULL ? $handler : $handler->getNamespace($namespace); }