src/diacronos/Lilo/FsUtils.php
/**
	 * Expand a relative path to an absolute path.
	 * Find matches in every path load and returns the first matched.
	 *
	 * @access  public
	 * @param   string   $relPath
	 * @return  string
	 * @throws \Exception if a $relPath doesn't exists
	 */
Expand a relative path to an absolute path.
Find matches in every path load and returns the first matched.

@access  public
@param   string   $relPath
@return  string
@throws \Exception if a $relPath doesn't exists
Expand a relative path to an absolute path . Find matches in every path load and returns the first matched . @access public @param string $relPath @return string @throws \ Exception if a $relPath doesn ' t exists
public function expand($relPath)
	{
		if (preg_match(self::EXPLICIT_PATH, $relPath) > 0) {
			return $relPath;
		}
		foreach ($this->_sources as $source) {
			if (preg_match(self::EXPLICIT_PATH, $source) > 0) {
				$path = self::join($source, $relPath);
				if (file_exists($path)) {
					return $path;
				}
			}
			$path = self::join(getcwd(), $source, $relPath);
			if (file_exists($path)) {
				return $path;
			}
		}
		throw new \Exception("Path {$relPath} can't be expanded to an absolute path");
	}
public function expand ( $ relPath ) { if ( preg_match ( self :: EXPLICIT_PATH , $ relPath ) > 0 ) { return $ relPath ; } foreach ( $ this -> _sources as $ source ) { if ( preg_match ( self :: EXPLICIT_PATH , $ source ) > 0 ) { $ path = self :: join ( $ source , $ relPath ) ; if ( file_exists ( $ path ) ) { return $ path ; } } $ path = self :: join ( getcwd ( ) , $ source , $ relPath ) ; if ( file_exists ( $ path ) ) { return $ path ; } } throw new \ Exception ( " Path  { $ relPath }  can't be expanded to an absolute path " ) ; }
Expand a relative path to an absolute path.
Expand a relative path to an absolute path .