Don't like ads? PRO users don't see any ads ;-)

Untitled

By: HosipLan on Jun 17th, 2012  |  syntax: PHP  |  size: 1.52 KB  |  hits: 49  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/env php
  2. <?php
  3.  
  4. // for the sanity
  5. require_once '/usr/include/php/nette/Nette/loader.php';
  6. Nette\Diagnostics\Debugger::enable(FALSE);
  7. Nette\Diagnostics\Debugger::$strictMode = TRUE;
  8.  
  9.  
  10. echo "testing nginx setup...\n\n";
  11. $domains = array(
  12.         'http://hosiplan.l' => 'http://hosiplan.l', // html index
  13.         'http://hosiplan.l/script.php?q=t' => 'http://hosiplan.l/script.php?q=t',
  14.         'http://hohosiplan.l/' => 'http://hohosiplan.l/index.php', // php index
  15.         'http://hohosiplan.l/rewrite' => 'http://hohosiplan.l/index.php',
  16.         'http://www.hosiplan.l' => 'http://hosiplan.l',
  17.         'http://www.hosiplan.l/script.php?q=t' => 'http://www.hosiplan.l/script.php?q=t',
  18.         'http://not-found.hosiplan.l' => 'http://hosiplan.l',
  19.         'http://not-found.hosiplan.l/script.php?q=t' => 'http://not-found.hosiplan.l/script.php?q=t',
  20.         'http://blabla.hosiplan.l' => 'http://blabla.hosiplan.l',
  21.         'http://blaphp.hosiplan.l' => 'http://blaphp.hosiplan.l/index.php',
  22.         'http://blaphp.hosiplan.l/rewrite' => 'http://blaphp.hosiplan.l/index.php',
  23.         'http://blaphp.hosiplan.l/index.php' => 'http://blaphp.hosiplan.l/index.php',
  24.         'http://blaphp.hosiplan.l/index.php?q=t' => 'http://blaphp.hosiplan.l/index.php?q=t',
  25.         'http://blaphp.hosiplan.l/script.php?q=t' => 'http://blaphp.hosiplan.l/script.php?q=t',
  26. );
  27.  
  28.  
  29. function test($rq, $expected)
  30. {
  31.         if (($actual = file_get_contents($rq)) !== $expected) {
  32.                 echo "FAILED $rq\n";
  33.                 dump($actual);
  34.  
  35.         } else {
  36.                 echo "OK $rq\n";
  37.         }
  38. }
  39.  
  40. foreach ($domains as $get => $expected) {
  41.         test($get, $expected);
  42.         echo "\n";
  43. }