Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 28 lines (22 sloc) 0.669 kB
1d0fd4a committing all the mobiley goodness.
scottjehl authored
1 <?php
5bfc08b @eddiemonge Issue 2499: Some php improvements
eddiemonge authored
2 // Get the filetype and array of files
3 if ( ! isset($type) || ! isset($files) )
d5a2ed2 @jblas Fixed 413 - Dev issue: our .htaccess file on the server is doing a 30…
jblas authored
4 {
5bfc08b @eddiemonge Issue 2499: Some php improvements
eddiemonge authored
5 echo '$type and $files must be specified!';
d5a2ed2 @jblas Fixed 413 - Dev issue: our .htaccess file on the server is doing a 30…
jblas authored
6 exit;
7 }
8
9 $contents = '';
3688e8f minor changes to combine.php
Eddie Monge authored
10
5bfc08b @eddiemonge Issue 2499: Some php improvements
eddiemonge authored
11 // Loop through the files adding them to a string
12 foreach ( $files as $file ) {
3688e8f minor changes to combine.php
Eddie Monge authored
13 $contents .= file_get_contents($file). "\n\n";
d5a2ed2 @jblas Fixed 413 - Dev issue: our .htaccess file on the server is doing a 30…
jblas authored
14 }
15
5bfc08b @eddiemonge Issue 2499: Some php improvements
eddiemonge authored
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
3688e8f minor changes to combine.php
Eddie Monge authored
22 header('Content-Type: ' . $type);
23 header('Content-Length: ' . strlen($contents));
5bfc08b @eddiemonge Issue 2499: Some php improvements
eddiemonge authored
24 header('Expires: Fri, 01 Jan 2010 05:00:00 GMT');
25
26 // Deliver the file
27 echo $contents;
Something went wrong with that request. Please try again.