示例#1
0
 /**
  * {@inheritDoc}
  * 
  * @see \wuyuan\base\ICacheDriver::flush()
  */
 public function flush()
 {
     if (empty($this->configs['cacheDir'])) {
         throw new CacheException('请指定缓存目录.');
     }
     try {
         \wuyuan\wy::removeAllFile($this->configs['cacheDir'], TRUE);
     } catch (\Exception $e) {
         throw new CacheException($e->getMessage());
     }
     return $this;
 }
示例#2
0
 /**
  * 清除模板编译文件.
  * $tplName 为 NULL, 清除全部模板编译文件; $tplName 格式参见 display 方法说明.
  *
  * @access public
  * @param string $tplName 模板名称, 默认 NULL.
  * @return boolean 清除成功返回 TRUE; 否则返回 FALSE.
  */
 public function cleanCompile($tplName = NULL)
 {
     if (NULL === $tplName) {
         return wy::removeAllFile($this->configs['compileDir'], TRUE);
     }
     return unlink($this->fetchViewPath($tplName)['compile']);
 }