PEEL Shopping
Open source ecommerce : PEEL Shopping
Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Static Protected Attributes
Minify_CSS_UriRewriter Class Reference

Static Public Member Functions

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...
 

Static Public Attributes

static $debugText = ''
 

Static Protected Member Functions

static _realpath ($path)
 Get realpath with any trailing slash removed. More...
 

Static Protected Attributes

static $className = 'Minify_CSS_UriRewriter'
 

Detailed Description

Definition at line 13 of file Minify_CSS_UriRewriter.php.

Member Function Documentation

static _realpath (   $path)
staticprotected

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 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$pathThe 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
string$uri
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$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 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$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 141 of file Minify_CSS_UriRewriter.php.

Field Documentation

$className = 'Minify_CSS_UriRewriter'
staticprotected

Definition at line 199 of file Minify_CSS_UriRewriter.php.

$debugText = ''
static

Definition at line 20 of file Minify_CSS_UriRewriter.php.


The documentation for this class was generated from the following file:

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:43 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.