/** * Selects the correct css uri rewriter, and applies it * * @param string $content the contents of the file to rewrite * @param string $filename the original location of the file * @param string $destination_filename the name of the file where the css will be written to * @return string The re-written content */ protected static function css_rewrite_uris($content, $filename, $destination_filename) { switch (static::$css_uri_rewriter) { case 'absolute': $rewritten = Casset_Cssurirewriter::rewrite($content, dirname($filename)); break; case 'relative': $rewritten = Casset_Cssurirewriterrelative::rewrite_css($content, dirname($filename), dirname($destination_filename)); break; case 'none': $rewritten = $content; break; default: throw new Casset_Exception('Unknown CSS URI rewriter: ' . static::$css_uri_rewriter); break; } return $rewritten; }