-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding new filter for css uri rewriting
- Loading branch information
Joeke Kloosterman
authored and
Joeke Kloosterman
committed
Jan 18, 2016
1 parent
7d09a89
commit 3c83801
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
core/components/modxminify/assetic/src/Assetic/Filter/CSSUriRewriteFilter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Assetic package, an OpenSky project. | ||
* | ||
* (c) 2010-2014 OpenSky Project Inc | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Assetic\Filter; | ||
|
||
use Assetic\Asset\AssetInterface; | ||
|
||
/** | ||
* URI rewrite from mrclay Minify | ||
* | ||
* @link https://github.com/mrclay/minify/blob/master/lib/Minify/CSS/UriRewriter.php | ||
*/ | ||
class CSSUriRewriteFilter implements FilterInterface | ||
{ | ||
public function filterLoad(AssetInterface $asset) | ||
{ | ||
} | ||
|
||
public function filterDump(AssetInterface $asset) | ||
{ | ||
$sourceBase = $asset->getSourceRoot(); | ||
$sourcePath = $asset->getSourcePath(); | ||
$targetPath = $asset->getTargetPath(); | ||
|
||
if (null === $sourcePath || null === $targetPath || $sourcePath == $targetPath) { | ||
return; | ||
} | ||
|
||
$content = \Minify_CSS_UriRewriter::rewrite( | ||
$asset->getContent() | ||
,$options['currentDir'] | ||
,$options['docRoot'] | ||
,$options['symlinks'] | ||
); | ||
|
||
// $asset->setContent(\Minify_CSS_UriRewriter::minify($asset->getContent())); | ||
} | ||
} |