\Minify_CSS_UriRewriter
Rewrite file-relative URIs as root-relative in CSS files
- Author: Stephen Clay <steve@mrclay.org>
Synopsis
class Minify_CSS_UriRewriter
{
- // members
- public static string $debugText = '';
- protected static string $className = 'Minify_CSS_UriRewriter';
- private static string $_currentDir = '';
- private static string $_docRoot = '';
- private static array $_symlinks = ;
- private static $_prependPath = NULL;
- // methods
- public static string rewrite()
- public static string prepend()
- public static string rewriteRelative()
- public static string removeDots()
- protected static mixed _realpath()
- private static string _trimUrls()
- private static string _processUriCB()
- private static string _owlifySvgPaths()
- private static string _unOwlify()
Members
private
- $_currentDir
—
string
Directory of this stylesheet - $_docRoot
—
string
DOC_ROOT - $_prependPath
—
string
Path to prepend - $_symlinks
—
array
directory replacements to map symlink targets back to their source (within the document root) E.g. '/var/www/symlink' => '/var/realpath'
protected
- $className
—
string
Defines which class to call as part of callbacks, change this if you extend Minify_CSS_UriRewriter
public
- $debugText
—
string
rewrite() and rewriteRelative() append debugging information here
Methods
private
- _owlifySvgPaths() — Mungs some inline SVG URL declarations so they won't be touched
- _processUriCB()
- _trimUrls()
- _unOwlify() — Undo work of _owlify
protected
- _realpath() — Get realpath with any trailing slash removed. If realpath() fails, just remove the trailing slash.
public
- prepend() — In CSS content, prepend a path to relative URIs
- removeDots() — Remove instances of "./" and "../" where possible from a root-relative URI
- rewrite() — In CSS content, rewrite file relative URIs as root relative
- rewriteRelative() — Get a root relative URI from a file relative URI