Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
25 | public function compress(array $urls, $type, $output) |
||
26 | { |
||
27 | $content = ''; |
||
28 | $fileName =''; |
||
29 | foreach ($urls as $url) |
||
30 | { |
||
31 | if ($this->fileManager->exists($url)) { |
||
32 | $fileName .= $url . $this->fileManager->lastModified($url); |
||
33 | $content .= $this->fileManager->read($url); |
||
34 | } |
||
35 | } |
||
36 | $fileName = md5($fileName); |
||
37 | |||
38 | $fileName = $fileName.'.'.$type; |
||
39 | |||
40 | Event::fire(Compressor::E_RESOURCE_COMPRESS, array($type, &$content)); |
||
41 | |||
42 | |||
43 | |||
44 | $this->fileManager->write($output.$fileName, $content); |
||
45 | |||
46 | return $fileName; |
||
47 | } |
||
48 | } |