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