* array('//symlink' => '/real/target/path') // unix * array('//static' => 'D:\\staticStorage') // Windows * * * 'docRoot': (default = $_SERVER['DOCUMENT_ROOT']) * see Minify_CSS_UriRewriter::rewrite * * @return string */ public static function minify($css, $options = array()) { $options = array_merge(array( 'compress' => true, 'removeCharsets' => true, 'preserveComments' => true, 'currentDir' => null, 'docRoot' => $_SERVER['DOCUMENT_ROOT'], 'prependRelativePath' => null, 'symlinks' => array(), ), $options); if ($options['removeCharsets']) { $css = preg_replace('/@charset[^;]+;\\s*/', '', $css); } if ($options['compress']) { if (!$options['preserveComments']) { $css = Minify_CSS_Compressor::process($css, $options); } else { $processor = array('Minify_CSS_Compressor', 'process'); $css = Minify_CommentPreserver::process($css, $processor, array($options)); } } if (!$options['currentDir'] && !$options['prependRelativePath']) { return $css; } if ($options['currentDir']) { $currentDir = $options['currentDir']; $docRoot = $options['docRoot']; $symlinks = $options['symlinks']; return Minify_CSS_UriRewriter::rewrite($css, $currentDir, $docRoot, $symlinks); } return Minify_CSS_UriRewriter::prepend($css, $options['prependRelativePath']); } }