public function path($filename)
    {
        if (preg_match('~^' . $this->base_directory . '~', $filename)) {
            return $filename;
        }

        return rtrim($this->base_directory, '/') . '/' . ltrim($filename, '/');
    }
public function path($filename)
    {
        if (preg_match('~^' . $this->base_directory . '~', $filename)) {
            return $filename;
        }

        return rtrim($this->base_directory, '/') . '/' . ltrim($filename, '/');
    }
public function path ( $ filename ) { if ( preg_match ( '~^' . $ this -> base_directory . '~' , $ filename ) ) { return $ filename ; } return rtrim ( $ this -> base_directory , '/' ) . '/' . ltrim ( $ filename , '/' ) ; }
Resolves file path.
Give the absolute path of a path

@param string $filename

@return string
Resolves file path . Give the absolute path of a path