Minify_CSS_UriRewriter::rewriteRelative
Get a root relative URI from a file relative URI
<code> Minify_CSS_UriRewriter::rewriteRelative( '../img/hello.gif' , '/home/user/www/css' // path of CSS file , '/home/user/www' // doc root ); // returns '/img/hello.gif' // example where static files are stored in a symlinked directory Minify_CSS_UriRewriter::rewriteRelative( 'hello.gif' , '/var/staticFiles/theme' , '/home/user/www' , array('/home/user/www/static' => '/var/staticFiles') ); // returns '/static/theme/hello.gif' </code>
Signature
public function rewriteRelative(string
$uri,
string
$realCurrentDir,
string
$realDocRoot,
[array
$symlinks = ] )
Parameters
$uri
— string- file relative URI
$realCurrentDir
— string- realpath of the current file's directory.
$realDocRoot
— string- realpath of the site document root.
$symlinks
— array- (default = array()) If the file is stored in
a symlink-ed directory, provide an array of link paths to
real target paths, where the link paths "appear" to be within the document
root. E.g.:
<code>
array('/home/foo/www/not/real/path' => '/real/target/path') // unix
array('C:\\htdocs\\not\\real' => 'D:\\real\\target\\path') // Windows
</code>
Returns
- string