File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 94
94
| setting this variable to TRUE (boolean). See the user guide for details.
95
95
|
96
96
*/
97
- $ config ['enable_hooks ' ] = FALSE ;
97
+ $ config ['enable_hooks ' ] = TRUE ;
98
98
99
99
/*
100
100
|--------------------------------------------------------------------------
456
456
| by the output class. Do not 'echo' any values with compression enabled.
457
457
|
458
458
*/
459
- $ config ['compress_output ' ] = FALSE ;
459
+ $ config ['compress_output ' ] = TRUE ;
460
460
461
461
/*
462
462
|--------------------------------------------------------------------------
Original file line number Diff line number Diff line change 11
11
| http://codeigniter.com/user_guide/general/hooks.html
12
12
|
13
13
*/
14
+
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 '
21
+ );
Original file line number Diff line number Diff line change
1
+ <?php
2
+ defined ('BASEPATH ' ) OR exit ('No direct script access allowed ' );
3
+
4
+ $ CI =& get_instance ();
5
+ $ buffer = $ CI ->output ->get_output ();
6
+
7
+ $ search = array (
8
+ '/\>[^\S ]+/s ' ,
9
+ '/[^\S ]+\</s ' ,
10
+ '/(\s)+/s ' ,
11
+ '#(?://)?<!\[CDATA\[(.*?)(?://)?\]\]>#s ' ,
12
+ '/\>(\s)+\</ '
13
+ );
14
+
15
+ $ replace = array (
16
+ '> ' ,
17
+ '< ' ,
18
+ '\\1 ' ,
19
+ "//<![CDATA[ \n" .'\1 ' ."\n//]]> " ,
20
+ '>< '
21
+ );
22
+
23
+ $ buffer = preg_replace ($ search , $ replace , $ buffer );
24
+
25
+ $ CI ->output ->set_output ($ buffer );
26
+ $ CI ->output ->_display ();
You can’t perform that action at this time.
0 commit comments