private static function setupConnection() { try { $conn = new Metaregistrar\EPP\metaregEppConnection(); if ($conn->setConnectionDetails(dirname(__FILE__) . '/testsetup.ini')) { if ($conn->login()) { return $conn; } } } catch (Metaregistrar\EPP\eppException $e) { echo "Test setup error in " . $e->getClass() . ": " . $e->getMessage() . "\n\n"; die; } return null; }
/* * This script checks for the availability of domain names * * You can specify multiple domain names to be checked */ if ($argc <= 1) { echo "Usage: infodomain.php <domainname>\n"; echo "Please enter a domain name retrieve\n\n"; die; } echo "Retrieving info on " . $domainname . "\n"; try { $conn = new Metaregistrar\EPP\metaregEppConnection(); $conn->setConnectionDetails(''); // Connect to the EPP server if ($conn->login()) { $result = infodomain($conn, $domainname); $conn->logout(); } } catch (Metaregistrar\EPP\eppException $e) { echo "ERROR: " . $e->getMessage() . "\n\n"; } /** * @param $conn Metaregistrar\EPP\eppConnection * @param $domainname string * @return string */ function infodomain($conn, $domainname) { try { $epp = new Metaregistrar\EPP\eppDomain($domainname);