示例#1
0
 /**
  * @return ICacheJournal
  */
 protected function getJournal()
 {
     return $this->context->getService('Nette\\Caching\\ICacheJournal');
 }
示例#2
0
	/**
	 * 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;
	}
示例#3
0
 /**
  * @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);
 }
示例#4
0
	/**
	 * @return Nette\Web\Session
	 */
	protected function getSession($namespace = NULL)
	{
		$handler = $this->context->getService('Nette\\Web\\Session');
		return $namespace === NULL ? $handler : $handler->getNamespace($namespace);
	}