ocCheck.php 799 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * AJAX checks for zlib.output_compression
  4. *
  5. * @package Minify
  6. */
  7. $_oc = ini_get('zlib.output_compression');
  8. // allow access only if builder is enabled
  9. require dirname(__FILE__) . '/../config.php';
  10. if (! $min_enableBuilder) {
  11. header('Location: /');
  12. exit;
  13. }
  14. if (isset($_GET['hello'])) {
  15. // echo 'World!'
  16. // try to prevent double encoding (may not have an effect)
  17. ini_set('zlib.output_compression', '0');
  18. require $min_libPath . '/HTTP/Encoder.php';
  19. HTTP_Encoder::$encodeToIe6 = true; // just in case
  20. $he = new HTTP_Encoder(array(
  21. 'content' => 'World!'
  22. ,'method' => 'deflate'
  23. ));
  24. $he->encode();
  25. $he->sendAll();
  26. } else {
  27. // echo status "0" or "1"
  28. header('Content-Type: text/plain');
  29. echo (int)$_oc;
  30. }