Property | Type | Description | |
---|---|---|---|
$debugText | string | rewrite() and rewriteRelative() append debugging information here |
Property | Type | Description | |
---|---|---|---|
$className | string | Defines which class to call as part of callbacks, change this if you extend Minify_CSS_UriRewriter |
Method | Description | |
---|---|---|
prepend ( string $css, string $path ) : string | In CSS content, prepend a path to relative URIs | |
removeDots ( string $uri ) : string | Remove instances of "./" and ". | |
rewrite ( string $css, string $currentDir, string $docRoot = null, array $symlinks = [] ) : string | In CSS content, rewrite file relative URIs as root relative | |
rewriteRelative ( string $uri, string $realCurrentDir, string $realDocRoot, array $symlinks = [] ) : string | Get a root relative URI from a file relative URI |
Method | Description | |
---|---|---|
_realpath ( string $path ) : mixed | Get realpath with any trailing slash removed. If realpath() fails, just remove the trailing slash. |
Method | Description | |
---|---|---|
_owlifySvgPaths ( string $css ) : string | Mungs some inline SVG URL declarations so they won't be touched | |
_processUriCB ( array $m ) : string | ||
_trimUrls ( string $css ) : string | ||
_unOwlify ( string $css ) : string | Undo work of _owlify |
public static removeDots ( string $uri ) : string | ||
$uri | string | |
return | string |
public static rewrite ( string $css, string $currentDir, string $docRoot = null, array $symlinks = [] ) : string | ||
$css | string | |
$currentDir | string | The directory of the current CSS file. |
$docRoot | string | The document root of the web site in which the CSS file resides (default = $_SERVER['DOCUMENT_ROOT']). |
$symlinks | array | (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
|
return | string |
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'
public static rewriteRelative ( string $uri, string $realCurrentDir, string $realDocRoot, array $symlinks = [] ) : string | ||
$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.:
array('/home/foo/www/not/real/path' => '/real/target/path') // unix
array('C:\\htdocs\\not\\real' => 'D:\\real\\target\\path') // Windows
|
return | string |
protected static string $className | ||
return | string |
public static string $debugText | ||
return | string |