| 1 |
<?php |
| 2 |
/** |
| 3 |
* AJAX checks for zlib.output_compression |
| 4 |
* |
| 5 |
* @package Minify |
| 6 |
*/ |
| 7 |
|
| 8 |
$app = (require __DIR__ . '/../bootstrap.php'); |
| 9 |
/* @var \Minify\App $app */ |
| 10 |
|
| 11 |
$_oc = ini_get('zlib.output_compression'); |
| 12 |
|
| 13 |
// allow access only if builder is enabled |
| 14 |
if (!$app->config->enableBuilder) { |
| 15 |
header('Location: /'); |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
if ($app->env->get('hello')) { |
| 20 |
// echo 'World!' |
| 21 |
|
| 22 |
// try to prevent double encoding (may not have an effect) |
| 23 |
ini_set('zlib.output_compression', '0'); |
| 24 |
|
| 25 |
HTTP_Encoder::$encodeToIe6 = true; // just in case |
| 26 |
$he = new HTTP_Encoder(array( |
| 27 |
'content' => str_repeat('0123456789', 500), |
| 28 |
'method' => 'deflate', |
| 29 |
)); |
| 30 |
$he->encode(); |
| 31 |
$he->sendAll(); |
| 32 |
} else { |
| 33 |
// echo status "0" or "1" |
| 34 |
header('Content-Type: text/plain'); |
| 35 |
echo (int)$_oc; |
| 36 |
} |
| 37 |
|