PluginProbe
Autoptimize / 1.6.1
Autoptimize v1.6.1
2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 All 107 releases
autoptimize / classes / autoptimizeHTML.php

autoptimizeHTML.php in Autoptimize 1.6.1, at classes/autoptimizeHTML.php

45 lines 753 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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