This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212|
1313*/
1414
15- /* http://php.quicoto.com/how-to-speed-up-codeigniter/ */
16- $ hook ['display_override ' ] = array (
17- 'class ' => '' ,
18- 'function ' => 'compress ' ,
19- 'filename ' => 'compress.php ' ,
20- 'filepath ' => 'hooks '
15+ /*
16+ | -------------------------------------------------------------------------
17+ | Compress output
18+ | -------------------------------------------------------------------------
19+ |
20+ */
21+ $ hook ['display_override ' ][] = array (
22+ 'class ' => '' ,
23+ 'function ' => 'minify_html ' ,
24+ 'filename ' => 'minify_html.php ' ,
25+ 'filepath ' => 'hooks '
2126);
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <?php
2+ defined ('BASEPATH ' ) OR exit ('No direct script access allowed ' );
3+
4+
5+ if ( ! function_exists ('minify_html ' ))
6+ {
7+ function minify_html ()
8+ {
9+ ini_set ('pcre.recursion_limit ' , '16777 ' );
10+
11+ $ CI =& get_instance ();
12+
13+ $ buffer = $ CI ->output ->get_output ();
14+
15+ $ re = '%(?>[^\S ]\s*| \s{2,})(?=[^<]*+(?:<(?!/?(?:textarea|pre|script)\b)[^<]*+)*+(?:<(?>textarea|pre|script)\b| \z))%Six ' ;
16+
17+ $ new_buffer = preg_replace ($ re , '' , $ buffer );
18+
19+ if ($ new_buffer === NULL )
20+ {
21+ $ new_buffer = $ buffer ;
22+ }
23+
24+ $ CI ->output ->set_output ($ new_buffer );
25+ $ CI ->output ->_display ();
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments