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