本文整理汇总了PHP中Minify_CSS_UriRewriter::rewriteRelative方法的典型用法代码示例。如果您正苦于以下问题:PHP Minify_CSS_UriRewriter::rewriteRelative方法的具体用法?PHP Minify_CSS_UriRewriter::rewriteRelative怎么用?PHP Minify_CSS_UriRewriter::rewriteRelative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Minify_CSS_UriRewriter
的用法示例。
在下文中一共展示了Minify_CSS_UriRewriter::rewriteRelative方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_Minify_CSS_UriRewriter
function test_Minify_CSS_UriRewriter()
{
global $thisDir;
Minify_CSS_UriRewriter::$debugText = '';
$in = file_get_contents($thisDir . '/_test_files/css_uriRewriter/in.css');
$expected = file_get_contents($thisDir . '/_test_files/css_uriRewriter/exp.css');
$actual = Minify_CSS_UriRewriter::rewrite($in, $thisDir . '/_test_files/css_uriRewriter', $thisDir);
$passed = assertTrue($expected === $actual, 'Minify_CSS_UriRewriter');
if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
echo "\n---Input:\n\n{$in}\n";
echo "\n---Output: " . strlen($actual) . " bytes\n\n{$actual}\n\n";
if (!$passed) {
echo "---Expected: " . strlen($expected) . " bytes\n\n{$expected}\n\n\n";
}
// show debugging only when test run directly
echo "--- Minify_CSS_UriRewriter::\$debugText\n\n", Minify_CSS_UriRewriter::$debugText;
}
Minify_CSS_UriRewriter::$debugText = '';
$in = '../../../../assets/skins/sam/sprite.png';
$exp = '/yui/assets/skins/sam/sprite.png';
$actual = Minify_CSS_UriRewriter::rewriteRelative($in, 'sf_root_dir\\web\\yui\\menu\\assets\\skins\\sam', 'sf_root_dir\\web');
$passed = assertTrue($exp === $actual, 'Minify_CSS_UriRewriter : Issue 99');
if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
echo "\n---Input:\n\n{$in}\n";
echo "\n---Output: " . strlen($actual) . " bytes\n\n{$actual}\n\n";
if (!$passed) {
echo "---Expected: " . strlen($exp) . " bytes\n\n{$exp}\n\n\n";
}
// show debugging only when test run directly
echo "--- Minify_CSS_UriRewriter::\$debugText\n\n", Minify_CSS_UriRewriter::$debugText;
}
}