示例#1
0
文件: FS.php 项目: techart/tao
 /**
  * Проверяет, соответствует ли заданный путь условиям поиска
  *
  * @param string $path
  *
  * @return boolean
  */
 public function allows($path = '.')
 {
     if (IO_FS::is_dir($path) && $this->recursive) {
         return true;
     }
     return Core_Regexps::match($this->regexp, (string) $path);
 }
示例#2
0
文件: Gallery.php 项目: techart/tao
 protected function mods_is_remake($path)
 {
     if (isset($this->remake_cache[$path])) {
         return $this->remake_cache[$path];
     }
     $mod = basename($path);
     $mods_info = $this->type->load_mods_info($this->dir());
     $files = $this->filelist();
     if (empty($files)) {
         return false;
     }
     $names = $this->files_names($files);
     $fn = array_combine($names, $files);
     $res = false;
     foreach ($fn as $name => $f) {
         if (IO_FS::is_dir($f)) {
             continue;
         }
         $search = $path . '/' . $name;
         if (is_file($search)) {
             if (!$mods_info[$name][$mod] && filemtime($search) < filemtime($f)) {
                 $res = true;
                 $this->to_remake[$name] = $search;
             }
         } else {
             $res = true;
             $this->to_remake[$name] = $search;
         }
     }
     $this->remake_cache[$path] = $res;
     return $res;
 }
示例#3
0
文件: FS.php 项目: techart/tao
 public function save_dir_info($name, $info)
 {
     $path = $this->path($name);
     if (!IO_FS::exists($path)) {
         return false;
     }
     if (!IO_FS::is_dir($path)) {
         return false;
     }
     $file = "{$path}/.info";
     $this->save_info($file, $info);
 }