mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Issue 2499: Some php improvements
This commit is contained in:
parent
6b2c1762ff
commit
5bfc08bba2
4 changed files with 24 additions and 14 deletions
20
combine.php
20
combine.php
|
|
@ -1,17 +1,27 @@
|
|||
<?php
|
||||
|
||||
if ( ! isset($type) || ! isset($elements) )
|
||||
// Get the filetype and array of files
|
||||
if ( ! isset($type) || ! isset($files) )
|
||||
{
|
||||
echo '$type and $elements must be specified!';
|
||||
echo '$type and $files must be specified!';
|
||||
exit;
|
||||
}
|
||||
|
||||
$contents = '';
|
||||
|
||||
foreach ( $elements as $file ) {
|
||||
// Loop through the files adding them to a string
|
||||
foreach ( $files as $file ) {
|
||||
$contents .= file_get_contents($file). "\n\n";
|
||||
}
|
||||
|
||||
// If gzip is supported, send the file gzipped
|
||||
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
|
||||
ob_start("ob_gzhandler");
|
||||
}
|
||||
|
||||
// Set the content type, filesize and an expiration so its not cached
|
||||
header('Content-Type: ' . $type);
|
||||
header('Content-Length: ' . strlen($contents));
|
||||
echo $contents;
|
||||
header('Expires: Fri, 01 Jan 2010 05:00:00 GMT');
|
||||
|
||||
// Deliver the file
|
||||
echo $contents;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
$type = "text/javascript";
|
||||
$elements = array(
|
||||
$type = 'text/javascript';
|
||||
$files = array(
|
||||
'jquery.ui.widget.js',
|
||||
'jquery.mobile.widget.js',
|
||||
'jquery.mobile.media.js',
|
||||
|
|
@ -38,4 +38,4 @@ $elements = array(
|
|||
'jquery.mobile.init.js'
|
||||
);
|
||||
|
||||
include('../combine.php');
|
||||
require_once('../combine.php');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
$type = "text/css";
|
||||
$elements = array(
|
||||
$type = 'text/css';
|
||||
$files = array(
|
||||
'jquery.mobile.theme.css',
|
||||
'jquery.mobile.core.css',
|
||||
'jquery.mobile.transitions.css',
|
||||
|
|
@ -19,4 +19,4 @@ $elements = array(
|
|||
'jquery.mobile.forms.slider.css'
|
||||
);
|
||||
|
||||
include('../../combine.php');
|
||||
require_once('../../combine.php');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
$type = "text/css";
|
||||
$elements = array(
|
||||
$type = 'text/css';
|
||||
$files = array(
|
||||
'jquery.mobile.theme.css',
|
||||
'../default/jquery.mobile.core.css',
|
||||
'../default/jquery.mobile.transitions.css',
|
||||
|
|
@ -19,4 +19,4 @@ $elements = array(
|
|||
'../default/jquery.mobile.forms.slider.css'
|
||||
);
|
||||
|
||||
include('../../combine.php');
|
||||
require_once('../../combine.php');
|
||||
|
|
|
|||
Loading…
Reference in a new issue