コード例 #1
0
ファイル: FileStore.php プロジェクト: railsphp/framework
 public function deleteMatched($matcher, array $options = [])
 {
     $allFiles = Toolbox\FileTools::searchFile($this->basePath);
     foreach ($allFiles as $file) {
         $key = urldecode(substr($file, strrpos($file, DIRECTORY_SEPARATOR) + 1));
         if (preg_match($matcher, $key)) {
             $this->getEntry($key, [])->delete();
         }
     }
     foreach (Toolbox\FileTools::listFilesRecursive($this->basePath) as $finfo) {
         $key = $finfo->getBaseName();
         $entry = $this->getEntry($key, []);
         if ($entry->expired()) {
             $entry->delete();
         }
     }
 }
コード例 #2
0
ファイル: FactoryGirl.php プロジェクト: railsphp/framework
 public function includeFactories(array $paths)
 {
     $includer = ClassTools::generateFileIncluder($this);
     foreach ($paths as $path) {
         foreach (FileTools::listFilesRecursive($path) as $file) {
             $includer($file->getRealPath());
         }
     }
 }