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(); } } }
public function includeFactories(array $paths) { $includer = ClassTools::generateFileIncluder($this); foreach ($paths as $path) { foreach (FileTools::listFilesRecursive($path) as $file) { $includer($file->getRealPath()); } } }