locations = $locations; } function locate($alias, $params = array()) { if(lmbFs :: isPathAbsolute($alias)) { if(file_exists($alias)) return $alias; else $this->_handleNotResolvedAlias($alias); } $paths = $this->locations->getLocations($params); foreach($paths as $path) { if(file_exists($path . '/' . $alias)) return $path . '/' . $alias; } $this->_handleNotResolvedAlias($alias); } function getFileLocations() { return $this->locations; } function locateAll($alias = '*') { $result = array(); $paths = $this->locations->getLocations(); foreach($paths as $path) { if($files = glob($path . '/' . $alias)) $result = array_merge($result, $files); } return array_unique($result); } protected function _handleNotResolvedAlias($alias) { throw new lmbFileNotFoundException($alias, 'file alias not resolved'); } } ?>