mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Added method to combine.php that writes the combined files to disk int the combined directory prior to being gzipped
This commit is contained in:
parent
bb59c278c3
commit
531b1a8863
1 changed files with 30 additions and 0 deletions
30
combine.php
30
combine.php
|
|
@ -26,9 +26,11 @@
|
|||
|
||||
|
||||
$cache = true;
|
||||
$write_combined = true;
|
||||
$pullfromcache = false;
|
||||
$theme = $_GET['theme'];
|
||||
$cachedir = dirname(__FILE__) . '/cache';
|
||||
$combinedir = dirname(__FILE__) . '/combined';
|
||||
$cssdir = dirname(__FILE__) . '/themes/' . $theme;
|
||||
$jsdir = dirname(__FILE__) . '/js';
|
||||
|
||||
|
|
@ -142,6 +144,34 @@
|
|||
$path = realpath($base . '/' . $element);
|
||||
$contents .= "\n\n" . file_get_contents($path);
|
||||
}
|
||||
|
||||
// Write pre gzipped files to disk
|
||||
if ($write_combined) {
|
||||
|
||||
if(!file_exists($combinedir)) {
|
||||
mkdir($combinedir, 0700);
|
||||
}
|
||||
|
||||
$filename = '';
|
||||
|
||||
//Determine the filename to use
|
||||
switch ($_GET['type']) {
|
||||
case 'css':
|
||||
$filename = 'jquery.mobile.css';
|
||||
break;
|
||||
case 'javascript':
|
||||
$filename = 'jquery.mobile.js';
|
||||
break;
|
||||
default:
|
||||
header ("HTTP/1.0 503 Not Implemented");
|
||||
exit;
|
||||
};
|
||||
|
||||
if ($fp = fopen($combinedir . '/' . $filename, 'wb')) {
|
||||
fwrite($fp, $contents);
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
// Send Content-Type
|
||||
header ("Content-Type: text/" . $type);
|
||||
|
|
|
|||
Loading…
Reference in a new issue