Moodle  2.2.1
http://www.collinsharper.com
Minify_CSS_UriRewriter Class Reference

Static Public Member Functions

static rewrite ($css, $currentDir, $docRoot=null, $symlinks=array())
static prepend ($css, $path)
static rewriteRelative ($uri, $realCurrentDir, $realDocRoot, $symlinks=array())

Static Public Attributes

static $debugText = ''

Static Protected Member Functions

static _realpath ($path)

Static Protected Attributes

static $className = 'Minify_CSS_UriRewriter'

Detailed Description

Definition at line 13 of file UriRewriter.php.


Member Function Documentation

static _realpath ( path) [static, protected]

Get realpath with any trailing slash removed. If realpath() fails, just remove the trailing slash.

Parameters:
string$path
Returns:
mixed path with no trailing slash

Definition at line 262 of file UriRewriter.php.

Here is the caller graph for this function:

string path to prepend ( css,
path 
) [static]

Prepend a path to relative URIs in CSS files

Parameters:
string$css
string$pathThe path to prepend.
Returns:
string

Definition at line 94 of file UriRewriter.php.

Here is the caller graph for this function:

static rewrite ( css,
currentDir,
docRoot = null,
symlinks = array() 
) [static]

Rewrite file relative URIs as root relative in CSS files

Parameters:
string$css
string$currentDirThe directory of the current CSS file.
string$docRootThe 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 50 of file UriRewriter.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static rewriteRelative ( uri,
realCurrentDir,
realDocRoot,
symlinks = array() 
) [static]

Rewrite a file relative URI as root relative

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$urifile relative URI
string$realCurrentDirrealpath of the current file's directory.
string$realDocRootrealpath 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 213 of file UriRewriter.php.


Field Documentation

$className = 'Minify_CSS_UriRewriter' [static, protected]

Definition at line 20 of file UriRewriter.php.

$debugText = '' [static]

Definition at line 26 of file UriRewriter.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations