2010-09-10 22:23:13 +00:00
|
|
|
<?php
|
2011-09-22 06:19:37 +00:00
|
|
|
// Get the filetype and array of files
|
|
|
|
|
if ( ! isset($type) || ! isset($files) )
|
2010-11-09 21:58:28 +00:00
|
|
|
{
|
2011-09-22 06:19:37 +00:00
|
|
|
echo '$type and $files must be specified!';
|
2010-11-09 21:58:28 +00:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$contents = '';
|
2011-06-09 08:51:37 +00:00
|
|
|
|
2011-09-22 06:19:37 +00:00
|
|
|
// Loop through the files adding them to a string
|
|
|
|
|
foreach ( $files as $file ) {
|
2011-06-09 08:51:37 +00:00
|
|
|
$contents .= file_get_contents($file). "\n\n";
|
2010-11-09 21:58:28 +00:00
|
|
|
}
|
|
|
|
|
|
2011-09-22 06:19:37 +00:00
|
|
|
// Set the content type, filesize and an expiration so its not cached
|
2011-06-09 08:51:37 +00:00
|
|
|
header('Content-Type: ' . $type);
|
|
|
|
|
header('Content-Length: ' . strlen($contents));
|
2011-09-22 06:19:37 +00:00
|
|
|
header('Expires: Fri, 01 Jan 2010 05:00:00 GMT');
|
|
|
|
|
|
2012-01-17 04:38:22 +00:00
|
|
|
//gzip it to speed up page load time (still not minified, for testing purposes)
|
|
|
|
|
ob_start("ob_gzhandler");
|
|
|
|
|
|
2011-09-22 06:19:37 +00:00
|
|
|
// Deliver the file
|
|
|
|
|
echo $contents;
|