|
static | rewrite ($css, $currentDir, $docRoot=null, $symlinks=array()) |
| In CSS content, rewrite file relative URIs as root relative. More...
|
|
static | prepend ($css, $path) |
| In CSS content, prepend a path to relative URIs. More...
|
|
static | rewriteRelative ($uri, $realCurrentDir, $realDocRoot, $symlinks=array()) |
| Get a root relative URI from a file relative URI. More...
|
|
static | removeDots ($uri) |
| Remove instances of "./" and "../" where possible from a root-relative URI. More...
|
|
Definition at line 13 of file Minify_CSS_UriRewriter.php.
static _realpath |
( |
|
$path | ) |
|
|
staticprotected |
Get realpath with any trailing slash removed.
If realpath() fails, just remove the trailing slash.
- Parameters
-
- Returns
- mixed path with no trailing slash
Definition at line 209 of file Minify_CSS_UriRewriter.php.
static prepend |
( |
|
$css, |
|
|
|
$path |
|
) |
| |
|
static |
In CSS content, prepend a path to relative URIs.
- Parameters
-
string | $css | |
string | $path | The path to prepend. |
- Returns
- string
Definition at line 87 of file Minify_CSS_UriRewriter.php.
static removeDots |
( |
|
$uri | ) |
|
|
static |
Remove instances of "./" and "../" where possible from a root-relative URI.
- Parameters
-
- Returns
- string
Definition at line 182 of file Minify_CSS_UriRewriter.php.
static rewrite |
( |
|
$css, |
|
|
|
$currentDir, |
|
|
|
$docRoot = null , |
|
|
|
$symlinks = array() |
|
) |
| |
|
static |
In CSS content, rewrite file relative URIs as root relative.
- Parameters
-
string | $css | |
string | $currentDir | The directory of the current CSS file. |
string | $docRoot | The document root of the web site in which the CSS file resides (default = $_SERVER['DOCUMENT_ROOT']). |
array | $symlinks | (default = array()) If the CSS file is stored in a symlink-ed directory, provide an array of link paths to target paths, where the link paths are within the document root. Because paths need to be normalized for this to work, use "//" to substitute the doc root in the link paths (the array keys). E.g.: array('//symlink' => '/real/target/path') // unix array('//static' => 'D:\staticStorage') // Windows |
- Returns
- string
Definition at line 44 of file Minify_CSS_UriRewriter.php.
static rewriteRelative |
( |
|
$uri, |
|
|
|
$realCurrentDir, |
|
|
|
$realDocRoot, |
|
|
|
$symlinks = array() |
|
) |
| |
|
static |
Get a root relative URI from a file relative URI.
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'
- Parameters
-
string | $uri | file relative URI |
string | $realCurrentDir | realpath of the current file's directory. |
string | $realDocRoot | realpath of the site document root. |
array | $symlinks | (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.: array('/home/foo/www/not/real/path' => '/real/target/path') // unix array('C:\htdocs\not\real' => 'D:\real\target\path') // Windows |
- Returns
- string
Definition at line 141 of file Minify_CSS_UriRewriter.php.
The documentation for this class was generated from the following file: