HighSpeaker/test.php

35 lines
678 B
PHP

<?php
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/support/bootstrap.php';
use Respect\Validation\Validator as v;
use yzh52521\EasyHttp\Response;
use yzh52521\EasyHttp\Http;
use yzh52521\EasyHttp\RequestException;
use GeoIp2\Database\Reader;
declare(ticks = 1);
function whoislookup($domain){
$whois = new Whois();
$query = $domain;
$result = $whois->Lookup($query,false);
echo '<pre>';
print_r($result);
echo '</pre>';
}
function sig()
{
throw new Exception;
}
try
{
pcntl_alarm(5);
pcntl_signal(SIGALRM, "sig");
whoislookup('layso.de');
pcntl_alarm(0);
}
catch(Exception $e)
{
echo "timeout\n";
}
?>