예제 #1
0
 /**
  * 返回配置缓存
  * 
  * @param string $alias 配置保存用的名字
  * @param string $append 配置追加的配置
  * @param AbstractWindCache $cache 配置保存的缓存介质
  * @return array
  */
 private function getCache($alias, $append, $cache)
 {
     if (!$append) {
         return $cache->get($alias);
     }
     if (isset($this->configs[$alias])) {
         return $this->configs[$alias];
     }
     $this->configs = $cache->get($append);
     return isset($this->configs[$alias]) ? $this->configs[$alias] : array();
 }
 /**
  * @return WindFactory
  */
 public function getFactory()
 {
     if ($this->_factory === null) {
         if ($this->_cache !== null && ($classes = $this->_cache->get('classes'))) {
             $imports = $this->_cache->get('imports');
             $classes && (Wind::$_classes += $classes);
             $imports && (Wind::$_imports += $imports);
             $this->_factory = $this->_cache->get('factory');
             $this->_config = $this->_cache->get('config');
             $this->_cached = true;
         }
         if (!$this->_factory) {
             $this->_loadBaseLib();
             $this->_factory = new WindFactory($this->_components());
         }
     }
     return $this->_factory;
 }