if ($argc <= 1) { echo "Usage: checklaunchdomain.php <domainnames>\n"; echo "Please enter one or more domain names to check\n\n"; die; } for ($i = 1; $i < $argc; $i++) { $domains[] = $argv[$i]; } echo "Checking " . count($domains) . " domain names\n"; try { $conn = new Metaregistrar\EPP\metaregEppConnection(true); $conn->enableLaunchphase('claims'); // Connect to the EPP server if ($conn->connect()) { if (login($conn)) { checkdomains($conn, $domains); logout($conn); } } else { echo "ERROR CONNECTING\n"; } } catch (Metaregistrar\EPP\eppException $e) { echo "ERROR: " . $e->getMessage() . "\n\n"; } /** * @param $conn Metaregistrar\EPP\eppConnection * @param $domains array */ function checkdomains($conn, $domains) { try {
$conn->setConnectionDetails(''); // Connect to the EPP server $mtime = microtime(); $mtime = explode(" ", $mtime); $starttime = $mtime[1] + $mtime[0]; if ($conn->login()) { $counter = 0; while ($counter < count($domains)) { $list[] = $domains[$counter]; $counter++; if ($counter % 10 == 0) { $mstime = microtime(); $mstime = explode(" ", $mstime); $mstime = $mstime[1] + $mstime[0]; $startstime = $mstime; checkdomains($conn, $list); $mstime = microtime(); $mstime = explode(" ", $mstime); $endstime = $mstime[1] + $mstime[0]; $totalstime = $endstime - $startstime; echo "Check: " . $totalstime . " seconds\n\n"; unset($list); } } $conn->logout(); } $mtime = microtime(); $mtime = explode(" ", $mtime); $endtime = $mtime[1] + $mtime[0]; $totaltime = $endtime - $starttime; echo "Checks performed in " . $totaltime . " seconds\n\n";