2008-08-29 22:56:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Front controller for default Minify implementation
|
|
|
|
*
|
|
|
|
* DO NOT EDIT! Configure this utility via config.php and groupsConfig.php
|
|
|
|
*
|
|
|
|
* @package Minify
|
|
|
|
*/
|
|
|
|
|
|
|
|
define('MINIFY_MIN_DIR', dirname(__FILE__));
|
|
|
|
|
|
|
|
// load config
|
|
|
|
require MINIFY_MIN_DIR . '/config.php';
|
|
|
|
|
|
|
|
// setup include path
|
|
|
|
set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
|
|
|
|
|
2008-09-18 01:56:29 +00:00
|
|
|
require 'Minify.php';
|
|
|
|
|
|
|
|
Minify::$uploaderHoursBehind = $min_uploaderHoursBehind;
|
|
|
|
Minify::setCache(
|
|
|
|
isset($min_cachePath) ? $min_cachePath : null
|
|
|
|
,$min_cacheFileLocking
|
|
|
|
);
|
2008-08-24 00:30:30 +00:00
|
|
|
|
2008-09-03 19:42:41 +00:00
|
|
|
if (0 === stripos(PHP_OS, 'win')) {
|
|
|
|
Minify::setDocRoot(); // we may be on IIS
|
|
|
|
}
|
2008-09-05 04:22:57 +00:00
|
|
|
if ($min_allowDebugFlag && isset($_GET['debug'])) {
|
|
|
|
$min_serveOptions['debug'] = true;
|
|
|
|
}
|
2008-08-29 22:56:34 +00:00
|
|
|
if (isset($_GET['g'])) {
|
2008-09-18 01:56:29 +00:00
|
|
|
// well need groups config
|
|
|
|
$min_serveOptions['minApp']['groups'] = (require MINIFY_MIN_DIR . '/groupsConfig.php');
|
|
|
|
// check for URI versioning
|
2008-08-29 22:56:34 +00:00
|
|
|
if (preg_match('/&\\d/', $_SERVER['QUERY_STRING'])) {
|
|
|
|
$min_serveOptions['maxAge'] = 31536000;
|
|
|
|
}
|
2008-09-18 01:56:29 +00:00
|
|
|
}
|
2008-09-03 05:13:52 +00:00
|
|
|
|
2008-09-18 01:56:29 +00:00
|
|
|
if (isset($_GET['f']) || isset($_GET['g'])) {
|
|
|
|
// serve!
|
|
|
|
Minify::serve('MinApp', $min_serveOptions);
|
|
|
|
|
2008-09-05 04:22:57 +00:00
|
|
|
} elseif ($min_enableBuilder) {
|
2008-09-03 05:13:52 +00:00
|
|
|
header('Location: builder/');
|
|
|
|
exit();
|
|
|
|
} else {
|
2008-09-05 04:22:57 +00:00
|
|
|
header("Location: /");
|
2008-09-03 05:13:52 +00:00
|
|
|
exit();
|
2008-08-29 22:56:34 +00:00
|
|
|
}
|