private function searchAssets($path, $extension, array $excludes = null) { $assets = array(); $assetPath = realpath($path . DIRECTORY_SEPARATOR . 'fixed'); if (is_dir($assetPath)) { $assets = Directory::recursiveSearchByExtension($assetPath, $extension, $excludes); } return $assets; }
/** * @expectedException \Exception */ public function testRecursiveSearchByExtensionWithUnexistantPath() { DirectoryUtils::recursiveSearchByExtension('some/unexistant/path', 'test'); }
/** * Generate the collections of assets for the a template. * @param string $extension * @return array|Traversable collections of assets */ public function generateCollection($paths, $extension) { $ret = array(); foreach ($paths as $path) { if (!is_dir($path)) { continue; } $files = DirectoryUtils::recursiveSearchByExtension($path, $extension); $ret = array_merge($ret, $files); } sort($ret); return $ret; }
/** * Searchs for assets inside the template path * * @param string $extension * @return Array */ public function searchAssets($extension, array $excludes = null) { $path = $this->getPath(); return DirectoryUtils::recursiveSearchByExtension($path, $extension, $excludes); }