index.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Front controller for default Minify implementation
  4. *
  5. * DO NOT EDIT! Configure this utility via config.php and groupsConfig.php
  6. *
  7. * @package Minify
  8. */
  9. define('MINIFY_MIN_DIR', dirname(__FILE__));
  10. // load config
  11. require MINIFY_MIN_DIR . '/config.php';
  12. // setup include path
  13. set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
  14. require 'Minify.php';
  15. Minify::$uploaderHoursBehind = $min_uploaderHoursBehind;
  16. Minify::setCache(
  17. isset($min_cachePath) ? $min_cachePath : ''
  18. ,$min_cacheFileLocking
  19. );
  20. if ($min_documentRoot) {
  21. $_SERVER['DOCUMENT_ROOT'] = $min_documentRoot;
  22. } elseif (0 === stripos(PHP_OS, 'win')) {
  23. Minify::setDocRoot(); // IIS may need help
  24. }
  25. $min_serveOptions['minifierOptions']['text/css']['symlinks'] = $min_symlinks;
  26. if ($min_allowDebugFlag && isset($_GET['debug'])) {
  27. $min_serveOptions['debug'] = true;
  28. }
  29. if ($min_errorLogger) {
  30. require_once 'Minify/Logger.php';
  31. if (true === $min_errorLogger) {
  32. require_once 'FirePHP.php';
  33. Minify_Logger::setLogger(FirePHP::getInstance(true));
  34. } else {
  35. Minify_Logger::setLogger($min_errorLogger);
  36. }
  37. }
  38. // check for URI versioning
  39. if (preg_match('/&\\d/', $_SERVER['QUERY_STRING'])) {
  40. $min_serveOptions['maxAge'] = 31536000;
  41. }
  42. if (isset($_GET['g'])) {
  43. // well need groups config
  44. $min_serveOptions['minApp']['groups'] = (require MINIFY_MIN_DIR . '/groupsConfig.php');
  45. }
  46. if (isset($_GET['f']) || isset($_GET['g'])) {
  47. // serve!
  48. Minify::serve('MinApp', $min_serveOptions);
  49. } elseif ($min_enableBuilder) {
  50. header('Location: builder/');
  51. exit();
  52. } else {
  53. header("Location: /");
  54. exit();
  55. }