File tree Expand file tree Collapse file tree 4 files changed +24
-14
lines changed
Expand file tree Collapse file tree 4 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 11<?php
2-
3- if ( ! isset ($ type ) || ! isset ($ elements ) )
2+ // Get the filetype and array of files
3+ if ( ! isset ($ type ) || ! isset ($ files ) )
44{
5- echo '$type and $elements must be specified! ' ;
5+ echo '$type and $files must be specified! ' ;
66 exit ;
77}
88
99$ contents = '' ;
1010
11- foreach ( $ elements as $ file ) {
11+ // Loop through the files adding them to a string
12+ foreach ( $ files as $ file ) {
1213 $ contents .= file_get_contents ($ file ). "\n\n" ;
1314}
1415
16+ // If gzip is supported, send the file gzipped
17+ if (substr_count ($ _SERVER ['HTTP_ACCEPT_ENCODING ' ], 'gzip ' )) {
18+ ob_start ("ob_gzhandler " );
19+ }
20+
21+ // Set the content type, filesize and an expiration so its not cached
1522header ('Content-Type: ' . $ type );
1623header ('Content-Length: ' . strlen ($ contents ));
17- echo $ contents ;
24+ header ('Expires: Fri, 01 Jan 2010 05:00:00 GMT ' );
25+
26+ // Deliver the file
27+ echo $ contents ;
Original file line number Diff line number Diff line change 11<?php
2- $ type = " text/javascript " ;
3- $ elements = array (
2+ $ type = ' text/javascript ' ;
3+ $ files = array (
44 'jquery.ui.widget.js ' ,
55 'jquery.mobile.widget.js ' ,
66 'jquery.mobile.media.js ' ,
3838 'jquery.mobile.init.js '
3939);
4040
41- include ('../combine.php ' );
41+ require_once ('../combine.php ' );
Original file line number Diff line number Diff line change 11<?php
2- $ type = " text/css " ;
3- $ elements = array (
2+ $ type = ' text/css ' ;
3+ $ files = array (
44 'jquery.mobile.theme.css ' ,
55 'jquery.mobile.core.css ' ,
66 'jquery.mobile.transitions.css ' ,
1919 'jquery.mobile.forms.slider.css '
2020);
2121
22- include ('../../combine.php ' );
22+ require_once ('../../combine.php ' );
Original file line number Diff line number Diff line change 11<?php
2- $ type = " text/css " ;
3- $ elements = array (
2+ $ type = ' text/css ' ;
3+ $ files = array (
44 'jquery.mobile.theme.css ' ,
55 '../default/jquery.mobile.core.css ' ,
66 '../default/jquery.mobile.transitions.css ' ,
1919 '../default/jquery.mobile.forms.slider.css '
2020);
2121
22- include ('../../combine.php ' );
22+ require_once ('../../combine.php ' );
You can’t perform that action at this time.
0 commit comments