mirror of
https://github.com/mrclay/minify.git
synced 2025-01-17 13:18:13 +01:00
4710509c68
Moves all dependency building into App bootstrap.php returns an App instance The app loads config files as necessary Moves logging to Monolog Moves HTTP digest auth to packagist component Rely on sys_get_temp_dir Env hosts $_POST and allows defaults when reading HTML helper uses the App and can handle less files Source factory assumes strings are filenames Fixes JsClosureCompilerTest::test6 (API now handles ES5 by default) Exclude JsClosureCompilerTest due to API limitations config.php can now return a Minify\Config object Variables set in config.php are now moved to a `Minify\Config` object, allowing better static analysis. The `zlib.output_compression` set is moved into `Minify::serve`.
38 lines
814 B
PHP
38 lines
814 B
PHP
<?php
|
|
/**
|
|
* AJAX checks for zlib.output_compression
|
|
*
|
|
* @package Minify
|
|
*/
|
|
|
|
$app = (require __DIR__ . '/../bootstrap.php');
|
|
/* @var \Minify\App $app */
|
|
|
|
$_oc = ini_get('zlib.output_compression');
|
|
|
|
// allow access only if builder is enabled
|
|
if (!$app->config->enableBuilder) {
|
|
header('Location: /');
|
|
exit;
|
|
}
|
|
|
|
if ($app->env->get('hello')) {
|
|
// echo 'World!'
|
|
|
|
// try to prevent double encoding (may not have an effect)
|
|
ini_set('zlib.output_compression', '0');
|
|
|
|
HTTP_Encoder::$encodeToIe6 = true; // just in case
|
|
$he = new HTTP_Encoder(array(
|
|
'content' => str_repeat('0123456789', 500),
|
|
'method' => 'deflate',
|
|
));
|
|
$he->encode();
|
|
$he->sendAll();
|
|
|
|
} else {
|
|
// echo status "0" or "1"
|
|
header('Content-Type: text/plain');
|
|
echo (int)$_oc;
|
|
}
|