コード例 #1
0
ファイル: FileStorage.php プロジェクト: Balvan/nette
 /**
  * @return ICacheJournal
  */
 protected function getJournal()
 {
     return $this->context->getService('Nette\\Caching\\ICacheJournal');
 }
コード例 #2
0
ファイル: Configurator.php プロジェクト: redhead/nette
	/**
	 * 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
ファイル: Configurator.php プロジェクト: JPalounek/IconStore
 /**
  * @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
ファイル: Application.php プロジェクト: redhead/nette
	/**
	 * @return Nette\Web\Session
	 */
	protected function getSession($namespace = NULL)
	{
		$handler = $this->context->getService('Nette\\Web\\Session');
		return $namespace === NULL ? $handler : $handler->getNamespace($namespace);
	}