Revision 7575,
1.1 KB
checked in by angelo, 12 years ago
(diff) |
Ticket #3197 - Reduzir tempo de carregamento do modulo Expresso Mail
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /* |
---|
4 | * This file is part of the Assetic package, an OpenSky project. |
---|
5 | * |
---|
6 | * (c) 2010-2012 OpenSky Project Inc |
---|
7 | * |
---|
8 | * For the full copyright and license information, please view the LICENSE |
---|
9 | * file that was distributed with this source code. |
---|
10 | */ |
---|
11 | |
---|
12 | namespace Assetic\Filter; |
---|
13 | |
---|
14 | use CssEmbed\CssEmbed; |
---|
15 | use Assetic\Asset\AssetInterface; |
---|
16 | |
---|
17 | /** |
---|
18 | * A filter that embed url directly into css |
---|
19 | * |
---|
20 | * @author Pierre Tachoire <pierre.tachoire@gmail.com> |
---|
21 | * @link https://github.com/krichprollsch/phpCssEmbed |
---|
22 | */ |
---|
23 | class PhpCssEmbedFilter implements FilterInterface |
---|
24 | { |
---|
25 | private $presets = array(); |
---|
26 | |
---|
27 | public function setPresets(array $presets) |
---|
28 | { |
---|
29 | $this->presets = $presets; |
---|
30 | } |
---|
31 | |
---|
32 | public function filterLoad(AssetInterface $asset) |
---|
33 | { |
---|
34 | $root = $asset->getSourceRoot(); |
---|
35 | $path = $asset->getSourcePath(); |
---|
36 | |
---|
37 | $pce = new CssEmbed(); |
---|
38 | if ($root && $path) { |
---|
39 | $pce->setRootDir(dirname($root.'/'.$path)); |
---|
40 | } |
---|
41 | |
---|
42 | $asset->setContent($pce->embedString($asset->getContent())); |
---|
43 | } |
---|
44 | |
---|
45 | public function filterDump(AssetInterface $asset) |
---|
46 | { |
---|
47 | } |
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.