
Untitled
By:
HosipLan on
Jun 17th, 2012 | syntax:
PHP | size: 1.52 KB | hits: 49 | expires: Never
#!/usr/bin/env php
<?php
// for the sanity
require_once '/usr/include/php/nette/Nette/loader.php';
Nette\Diagnostics\Debugger::enable(FALSE);
Nette\Diagnostics\Debugger::$strictMode = TRUE;
echo "testing nginx setup...\n\n";
$domains = array(
'http://hosiplan.l' => 'http://hosiplan.l', // html index
'http://hosiplan.l/script.php?q=t' => 'http://hosiplan.l/script.php?q=t',
'http://hohosiplan.l/' => 'http://hohosiplan.l/index.php', // php index
'http://hohosiplan.l/rewrite' => 'http://hohosiplan.l/index.php',
'http://www.hosiplan.l' => 'http://hosiplan.l',
'http://www.hosiplan.l/script.php?q=t' => 'http://www.hosiplan.l/script.php?q=t',
'http://not-found.hosiplan.l' => 'http://hosiplan.l',
'http://not-found.hosiplan.l/script.php?q=t' => 'http://not-found.hosiplan.l/script.php?q=t',
'http://blabla.hosiplan.l' => 'http://blabla.hosiplan.l',
'http://blaphp.hosiplan.l' => 'http://blaphp.hosiplan.l/index.php',
'http://blaphp.hosiplan.l/rewrite' => 'http://blaphp.hosiplan.l/index.php',
'http://blaphp.hosiplan.l/index.php' => 'http://blaphp.hosiplan.l/index.php',
'http://blaphp.hosiplan.l/index.php?q=t' => 'http://blaphp.hosiplan.l/index.php?q=t',
'http://blaphp.hosiplan.l/script.php?q=t' => 'http://blaphp.hosiplan.l/script.php?q=t',
);
function test($rq, $expected)
{
if (($actual = file_get_contents($rq)) !== $expected) {
echo "FAILED $rq\n";
dump($actual);
} else {
echo "OK $rq\n";
}
}
foreach ($domains as $get => $expected) {
test($get, $expected);
echo "\n";
}