autoptimizeHTML.php in Autoptimize 0.2, at classes/autoptimizeHTML.php
| 1 | <?php |
| 2 | |
| 3 | class autoptimizeHTML extends autoptimizeBase |
| 4 | { |
| 5 | private $url = ''; |
| 6 | |
| 7 | //Does nothing |
| 8 | public function read() |
| 9 | { |
| 10 | //Nothing to read for HTML |
| 11 | return true; |
| 12 | } |
| 13 | |
| 14 | //Joins and optimizes CSS |
| 15 | public function minify() |
| 16 | { |
| 17 | if(class_exists('Minify_HTML')) |
| 18 | { |
| 19 | //Remove whitespace |
| 20 | $this->content = Minify_HTML::minify($this->content); |
| 21 | return true; |
| 22 | } |
| 23 | |
| 24 | //Didn't minify :( |
| 25 | return false; |
| 26 | } |
| 27 | |
| 28 | //Does nothing |
| 29 | public function cache() |
| 30 | { |
| 31 | //No cache for HTML |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | //Returns the content |
| 36 | public function getcontent() |
| 37 | { |
| 38 | return $this->content; |
| 39 | } |
| 40 | } |
| 41 |