├── .gitignore ├── Adapter ├── AbstractAdapter.php ├── Http.php └── Socket.php ├── CHANGELOG.md ├── Config ├── Config.php ├── proxy.ini └── whois.ini ├── Exception ├── AbstractException.php ├── ConnectErrorException.php ├── Exception.php ├── NoAdapterException.php ├── NoQueryException.php ├── NoTemplateException.php ├── RateLimitException.php ├── ReadErrorException.php └── WriteErrorException.php ├── Parser.php ├── README.md ├── Result ├── AbstractResult.php ├── Contact.php ├── Registrar.php └── Result.php ├── Templates ├── Adamsnames.php ├── Ae.php ├── Afilias.php ├── Afnic.php ├── Afrinic.php ├── Agency.php ├── Ai.php ├── Am.php ├── Apnic.php ├── Arin.php ├── Asnic.php ├── At.php ├── Au.php ├── Ax.php ├── Be.php ├── Bg.php ├── Bj.php ├── Bo.php ├── Br.php ├── Buzz ├── By.php ├── Ca.php ├── Cd.php ├── Ck.php ├── Club.php ├── Cocca.php ├── Comua.php ├── Coop.php ├── Cz.php ├── De.php ├── Dk.php ├── Dm.php ├── Dz.php ├── Edu.php ├── Ee.php ├── Email.php ├── Es.php ├── Eu.php ├── Fi.php ├── Fj.php ├── Fo.php ├── Gtld_cpsdatensysteme.php ├── Gtld_deutschetelekom.php ├── Gtld_enom.php ├── Gtld_gandi.php ├── Gtld_godaddy.php ├── Gtld_hetzner.php ├── Gtld_joker.php ├── Gtld_markmonitor.php ├── Gtld_melbourneit.php ├── Gtld_name.php ├── Gtld_networksolutions.php ├── Gtld_psiusa.php ├── Gtld_rf.php ├── Gtld_rrpproxy.php ├── Gtld_schlund.php ├── Gtld_variomedia.php ├── Gtld_vautron.php ├── Gtld_xinnet.php ├── Hk.php ├── Hm.php ├── Hu.php ├── Iana.php ├── Icb.php ├── Ie.php ├── Il.php ├── Im.php ├── Int.php ├── Io.php ├── Ir.php ├── Is.php ├── It.php ├── It_registrar.php ├── Jp.php ├── Kg.php ├── Kr.php ├── Krnic.php ├── Kz.php ├── Lacnic.php ├── Link.php ├── Lt.php ├── Lu.php ├── Lv.php ├── Ly.php ├── Md.php ├── Mx.php ├── Nc.php ├── Neustar.php ├── Nl.php ├── No.php ├── Nu.php ├── Nz.php ├── Om.php ├── Pl.php ├── Pr.php ├── Pt.php ├── Qa.php ├── Ripe.php ├── Ro.php ├── Rs.php ├── Ru.php ├── Se.php ├── Sg.php ├── Sk.php ├── Sm.php ├── St.php ├── Standard.php ├── Standardliar.php ├── Su.php ├── Support.php ├── Switchnic.php ├── Th.php ├── Tk.php ├── Tn.php ├── Tr.php ├── Tv.php ├── Tw.php ├── Type │ ├── AbstractTemplate.php │ ├── KeyValue.php │ └── Regex.php ├── Ua.php ├── Ug.php ├── Uk.php ├── Uy.php ├── Ve.php ├── Venez.php ├── Verisign.php ├── Vu.php └── Ws.php └── composer.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /Adapter/AbstractAdapter.php: -------------------------------------------------------------------------------- 1 | proxyConfig = $proxyConfig; 60 | } 61 | 62 | /** 63 | * Send data to whois server 64 | * 65 | * @param object $query 66 | * @param array $config 67 | * @return string 68 | */ 69 | abstract public function call($query, $config); 70 | 71 | /** 72 | * Creates an adapter by type 73 | * 74 | * Returns a adapter object, if not null. 75 | * Socket or HTTP, default is socket. 76 | * 77 | * @param string $type 78 | * @param string|null $proxyConfig 79 | * @param string|null $customNamespace 80 | * @return AbstractAdapter 81 | */ 82 | public static function factory($type = 'socket', $proxyConfig = null, $customNamespace = null) 83 | { 84 | $obj = null; 85 | // Ensure the custom namespace ends with a \ 86 | $customNamespace = rtrim($customNamespace, '\\') .'\\'; 87 | if ((strpos($type, '\\') !== false) && class_exists($type)) { 88 | $obj = new $type($proxyConfig); 89 | } elseif ((strlen($customNamespace) > 1) && class_exists($customNamespace . ucfirst($type))) { 90 | $class = $customNamespace . ucfirst($type); 91 | $obj = new $class($proxyConfig); 92 | } elseif (class_exists('Novutec\WhoisParser\Adapter\\'. ucfirst($type))) { 93 | $class = 'Novutec\WhoisParser\Adapter\\' . ucfirst($type); 94 | $obj = new $class($proxyConfig); 95 | } 96 | return $obj; 97 | } 98 | } -------------------------------------------------------------------------------- /Adapter/Http.php: -------------------------------------------------------------------------------- 1 | sock = curl_init(); 53 | $replacements = array( 54 | '%domain%' => $query->idnFqdn, 55 | '%subdomain%' => $query->domain, 56 | '%tld%' => $query->tld, 57 | ); 58 | $url = $config['server'] . str_replace(array_keys($replacements), array_values($replacements), $config['format']); 59 | 60 | curl_setopt($this->sock, CURLOPT_USERAGENT, 'PHP'); 61 | curl_setopt($this->sock, CURLOPT_TIMEOUT, 30); 62 | curl_setopt($this->sock, CURLOPT_HEADER, false); 63 | curl_setopt($this->sock, CURLOPT_SSL_VERIFYPEER, 'OFF'); 64 | curl_setopt($this->sock, CURLOPT_SSLVERSION, 3); 65 | curl_setopt($this->sock, CURLOPT_RETURNTRANSFER, true); 66 | curl_setopt($this->sock, CURLOPT_POST, false); 67 | curl_setopt($this->sock, CURLOPT_URL, $url); 68 | 69 | $rawdata = curl_exec($this->sock); 70 | 71 | curl_close($this->sock); 72 | 73 | return $rawdata; 74 | } 75 | } -------------------------------------------------------------------------------- /Config/proxy.ini: -------------------------------------------------------------------------------- 1 | ;---------------------------------------------------------------- 2 | ; ENABLING PROXY SUPPORT FOR SOCKET ADAPTER 3 | ; ONLY HTTP(S) PROXIES (NOT SOCKS) ARE SUPPORTED 4 | ; 5 | ; If you add multiple proxies, random one will be chosen 6 | ; Add a new proxy by specifying a new section like [proxy name] 7 | ; 8 | ; Uncomment lines '[proxy name]', 'enabled', 'host', 'port' and 'type' to use a proxy 9 | ; Add username and password if proxy requires authentication 10 | ; Only basic authorization is supported 11 | ;---------------------------------------------------------------- 12 | 13 | ;[proxy 1] 14 | ;enabled = 0 15 | ;username = 16 | ;password = 17 | ;host = 127.0.0.1 18 | ;port = 8123 19 | ;type = http 20 | 21 | ;[proxy 2] 22 | ;enabled = 1 23 | ;username = 24 | ;password = 25 | ;host = example.com 26 | ;port = 60000 27 | ;type = https 28 | -------------------------------------------------------------------------------- /Exception/AbstractException.php: -------------------------------------------------------------------------------- 1 | {$name} = $value; 48 | } 49 | 50 | /** 51 | * Checking data 52 | * 53 | * @param mixed $name 54 | * @return boolean 55 | */ 56 | public function __isset($name) 57 | { 58 | return isset($this->{$name}); 59 | } 60 | 61 | /** 62 | * Reading data from properties 63 | * 64 | * @param string $name 65 | * @return void 66 | */ 67 | public function __get($name) 68 | { 69 | if (isset($this->{$name})) { 70 | return $this->{$name}; 71 | } 72 | 73 | return null; 74 | } 75 | } -------------------------------------------------------------------------------- /Result/Contact.php: -------------------------------------------------------------------------------- 1 | toArray()); 158 | } 159 | 160 | /** 161 | * Convert properties to array 162 | * 163 | * @return array 164 | */ 165 | public function toArray() 166 | { 167 | return get_object_vars($this); 168 | } 169 | } -------------------------------------------------------------------------------- /Result/Registrar.php: -------------------------------------------------------------------------------- 1 | toArray()); 70 | } 71 | 72 | /** 73 | * Convert properties to array 74 | * 75 | * @return array 76 | */ 77 | public function toArray() 78 | { 79 | return get_object_vars($this); 80 | } 81 | } -------------------------------------------------------------------------------- /Templates/Ae.php: -------------------------------------------------------------------------------- 1 | '/Domain Name:(?>[\x20\t]*)(.*?)(?=Registrant Contact ID)/is', 47 | 2 => '/Registrant Contact ID:(?>[\x20\t]*)(.*?)(?=Tech Contact ID)/is', 48 | 3 => '/Tech Contact ID:(?>[\x20\t]*)(.*?)(?=Name Server)/is', 49 | 4 => '/Name Server:(?>[\x20\t]*)(.*?)$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/^Registrar ID:(?>[\x20\t]*)(.+)$/im' => 'registrar:id', 59 | '/^Registrar Name:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 60 | '/^Status:(?>[\x20\t]*)(.+)$/im' => 'status'), 61 | 2 => array('/^Registrant Contact ID:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 62 | '/^Registrant Contact Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name'), 63 | 3 => array('/^Tech Contact ID:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 64 | '/^Tech Contact Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name'), 65 | 4 => array('/^Name Server:(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 66 | 67 | /** 68 | * RegEx to check availability of the domain name 69 | * 70 | * @var string 71 | * @access protected 72 | */ 73 | protected $available = '/No Data Found/i'; 74 | } -------------------------------------------------------------------------------- /Templates/Afrinic.php: -------------------------------------------------------------------------------- 1 | '/(inetnum|inet6num):(?>[\x20\t]*)(.*?)(?=person|organisation)/is', 47 | 2 => '/(role|person|organisation):(?>[\x20\t]*)(.*?)[\r\n]{2}/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^inetnum:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 57 | '/^inet6num:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 58 | '/^netname:(?>[\x20\t]*)(.+)$/im' => 'network:name', 59 | '/^mnt-by:(?>[\x20\t]*)(.+)$/im' => 'network:maintainer', 60 | '/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 61 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 62 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 63 | '/^org:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:owner'), 64 | 65 | 2 => array('/^organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 66 | '/^org:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 67 | '/^nic-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 68 | '/^org-name:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 69 | '/^role:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 70 | '/^person:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 71 | '/^address:(?>[\x20\t]*)(.+)/im' => 'contacts:address', 72 | '/^abuse-mailbox:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 73 | '/^e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 74 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 75 | '/^fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax')); 76 | } -------------------------------------------------------------------------------- /Templates/Agency.php: -------------------------------------------------------------------------------- 1 | '/Domain Name:(.*?)(?=Registrant ID)/is' 48 | ); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/Registry Expiry Date:(?>[\x20\t]*)(.+)$/im' => 'expires') 58 | ); 59 | } -------------------------------------------------------------------------------- /Templates/Apnic.php: -------------------------------------------------------------------------------- 1 | '/(inetnum|inet6num):(?>[\x20\t]*)(.*?)source:(?>[\x20\t]*)apnic/is', 48 | 2 => '/(role|person|organisation):(?>[\x20\t]*)(.*?)source:(?>[\x20\t]*)apnic/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/^inetnum:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 58 | '/^inet6num:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 59 | '/^netname:(?>[\x20\t]*)(.+)$/im' => 'network:name', 60 | '/^mnt-by:(?>[\x20\t]*)(.+)$/im' => 'network:maintainer', 61 | '/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 62 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 63 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 64 | '/^source:(?>[\x20\t]*)(.+)$/im' => 'network:source'), 65 | 66 | 2 => array('/^organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 67 | '/^org:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 68 | '/^nic-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 69 | '/^org-name:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 70 | '/^role:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 71 | '/^person:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 72 | '/^address:(?>[\x20\t]*)(.+)/im' => 'contacts:address', 73 | '/^abuse-mailbox:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 74 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 75 | '/^fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax')); 76 | 77 | /** 78 | * After parsing do something 79 | * 80 | * If APNIC says the organization is KRNIC then connect to KRNIC and 81 | * start over again. 82 | * 83 | * @param object &$WhoisParser 84 | * @return void 85 | */ 86 | public function postProcess(&$WhoisParser) 87 | { 88 | $ResultSet = $WhoisParser->getResult(); 89 | $Config = $WhoisParser->getConfig(); 90 | 91 | if (isset($ResultSet->network->name) && $ResultSet->network->name === 'KRNIC-KR') { 92 | $ResultSet->reset(); 93 | $Config->setCurrent($Config->get('krnic')); 94 | $WhoisParser->call(); 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /Templates/Asnic.php: -------------------------------------------------------------------------------- 1 | '/Registered by:(?>[\x20\t]*)(.*?)(?=Nameservers:)/is', 47 | 2 => '/Nameservers:(?>[\x20\t]*)(.*?)(?=Access to ASNIC)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/Registered by:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name'), 57 | 2 => array('/Nameservers:(?>[\x20\t]*)(.+)$/is' => 'nameserver')); 58 | 59 | /** 60 | * RegEx to check availability of the domain name 61 | * 62 | * @var string 63 | * @access protected 64 | */ 65 | protected $available = '/Domain Not Found/i'; 66 | 67 | /** 68 | * After parsing ... 69 | * 70 | * Fix nameserver and IP addresses in WHOIS output 71 | * 72 | * @param object &$WhoisParser 73 | * @return void 74 | */ 75 | public function postProcess(&$WhoisParser) 76 | { 77 | $ResultSet = $WhoisParser->getResult(); 78 | $filteredNameserver = array(); 79 | $filteredIps = array(); 80 | 81 | if ($ResultSet->nameserver != '') { 82 | $explodedNameserver = array_map('trim', explode("\n", trim($ResultSet->nameserver))); 83 | 84 | foreach ($explodedNameserver as $line) { 85 | preg_match('/(.+) \((.+)\)$/im', $line, $matches); 86 | $filteredNameserver[] = $matches[1]; 87 | $filteredIps[] = $matches[2]; 88 | } 89 | 90 | $ResultSet->nameserver = $filteredNameserver; 91 | $ResultSet->ips = $filteredIps; 92 | } 93 | } 94 | } -------------------------------------------------------------------------------- /Templates/Au.php: -------------------------------------------------------------------------------- 1 | '/Domain Name:(?>[\x20\t]*)(.*?)(?=Registrant:)/is', 47 | 2 => '/Registrant:(?>[\x20\t]*)(.*?)(?=Tech Contact ID:)/is', 48 | 3 => '/Tech Contact ID:(?>[\x20\t]*)(.*?)(?=Name Server)/is', 49 | 4 => '/Name Server:(?>[\x20\t]*)(.*?)$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/Registrar ID:(?>[\x20\t]*)(.+)$/im' => 'registrar:id', 59 | '/Registrar Name:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 60 | '/Status:(?>[\x20\t]*)(.+)$/im' => 'status', 61 | '/Last Modified:(?>[\x20\t]*)(.+)$/im' => 'changed'), 62 | 2 => array('/Registrant Contact ID:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 63 | '/Registrant Contact Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 64 | '/Registrant:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', 65 | '/Eligibility Type:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:eligibility_type', 66 | '/Eligibility Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:eligibility_name', 67 | '/Eligibility ID:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:eligibility_id'), 68 | 3 => array('/Tech Contact ID:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 69 | '/Tech Contact Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name'), 70 | 4 => array('/Name Server:(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 71 | 72 | /** 73 | * RegEx to check availability of the domain name 74 | * 75 | * @var string 76 | * @access protected 77 | */ 78 | protected $available = '/No Data Found/i'; 79 | } -------------------------------------------------------------------------------- /Templates/Ax.php: -------------------------------------------------------------------------------- 1 | '/Domain Name:(?>[\x20\t]*)(.*?)(?=Name Server)/is', 47 | 2 => '/Name Server 1:(?>[\x20\t]*)(.*?)$/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 57 | '/Administrative Contact:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:name', 58 | '/Email address:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:email', 59 | '/Address:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:address', 60 | '/Country:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:country', 61 | '/Telephone:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:phone', 62 | '/Created:(?>[\x20\t]*)(.+)$/im' => 'created'), 63 | 2 => array('/Name Server [0-9]:(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 64 | 65 | /** 66 | * RegEx to check availability of the domain name 67 | * 68 | * @var string 69 | * @access protected 70 | */ 71 | protected $available = '/No records matching/i'; 72 | 73 | /** 74 | * After parsing ... 75 | * 76 | * Fix UTF-8 77 | * 78 | * @param object &$WhoisParser 79 | * @return void 80 | */ 81 | public function postProcess(&$WhoisParser) 82 | { 83 | $ResultSet = $WhoisParser->getResult(); 84 | $filteredAddress = array(); 85 | 86 | foreach ($ResultSet->contacts as $contactType => $contactArray) { 87 | foreach ($contactArray as $contactObject) { 88 | $contactObject->name = utf8_encode($contactObject->name); 89 | if (is_array($contactObject->address)) { 90 | foreach ($contactObject->address as $elem) { 91 | $filteredAddress[] = utf8_encode($elem); 92 | } 93 | $contactObject->address = $filteredAddress; 94 | } else { 95 | $contactObject->address = utf8_encode($contactObject->address); 96 | } 97 | } 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /Templates/Be.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)(?=registrant)/is', 47 | 2 => '/registrar technical contacts:\n(.*?)(?=registrar:)/is', 48 | 3 => '/registrar:\n(.*?)(?=nameservers)/is', 4 => '/nameservers:\n(.*?)(?=keys:)/is', 49 | 5 => '/keys:\n(.*?)(?=Please visit)/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/status:(?>[\x20\t]*)(.+)$/im' => 'status', 59 | '/Registered:(?>[\x20\t]*)(.+)$/im' => 'created'), 60 | 2 => array('/name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 61 | '/organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:organization', 62 | '/language:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:language', 63 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone', 64 | '/fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:fax', 65 | '/email:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:email'), 66 | 3 => array('/name:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 67 | '/website:(?>[\x20\t]*)(.+)$/im' => 'registrar:url'), 68 | 4 => array('/\n(?>[\x20\t]+)(.+)$/im' => 'nameserver', 69 | '/\n(?>[\x20\t]+)(.+) \(.+\)$/im' => 'nameserver', 70 | '/\n(?>[\x20\t]+).+ \((.+)\)$/im' => 'ips'), 71 | 5 => array('/keyTag:(.+)$/im' => 'dnssec')); 72 | 73 | /** 74 | * RegEx to check availability of the domain name 75 | * 76 | * @var string 77 | * @access protected 78 | */ 79 | protected $available = '/Status:(?>[\x20\t]*)AVAILABLE/i'; 80 | 81 | /** 82 | * After parsing .. 83 | * 84 | * If dnssec key was found we set attribute to true 85 | * 86 | * @param object &$WhoisParser 87 | * @return void 88 | */ 89 | public function postProcess(&$WhoisParser) 90 | { 91 | $ResultSet = $WhoisParser->getResult(); 92 | 93 | if ($ResultSet->dnssec != '') { 94 | $ResultSet->dnssec = true; 95 | } else { 96 | $ResultSet->dnssec = false; 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /Templates/Bj.php: -------------------------------------------------------------------------------- 1 | '/Domain Name:(?>[\x20\t]*)(.*?)[\n]{2}/is', 47 | 2 => '/Person:(?>[\x20\t]*)(.*?)(?=To single out)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^Last Updated:(?>[\x20\t]*)(.+)$/im' => 'changed', 57 | '/^Created:(?>[\x20\t]*)(.+)$/im' => 'created', 58 | '/^Administrative Contact:(?>[\x20\t]*)(.+)$/im' => 'network:contact:admin', 59 | '/^Technical Contact:(?>[\x20\t]*)(.+)$/im' => 'network:contact:tech', 60 | '/^Name Server [0-9]*:(?>[\x20\t]*)(.+)$/im' => 'nameserver'), 61 | 2 => array('/^Name:(?>[\x20\t]*)(.+)$/im' => 'contact:name', 62 | '/^Email address:(?>[\x20\t]*)(.+)$/im' => 'contact:email', 63 | '/^Address:(?>[\x20\t]*)(.+)$/im' => 'contact:address', 64 | '/^Country:(?>[\x20\t]*)(.+)$/im' => 'contact:country', 65 | '/^Telephone:(?>[\x20\t]*)(.+)$/im' => 'contact:phone', 66 | '/^FAX No:(?>[\x20\t]*)(.+)$/im' => 'contact:fax', 67 | '/^Created:(?>[\x20\t]*)(.+)$/im' => 'contact:created', 68 | '/^Last Updated:(?>[\x20\t]*)(.+)$/im' => 'contact:changed')); 69 | 70 | /** 71 | * RegEx to check availability of the domain name 72 | * 73 | * @var string 74 | * @access protected 75 | */ 76 | protected $available = '/No records matching/i'; 77 | 78 | /** 79 | * After parsing ... 80 | * 81 | * Get contact handles 82 | * 83 | * @param object &$WhoisParser 84 | * @return void 85 | */ 86 | public function postProcess(&$WhoisParser) 87 | { 88 | $ResultSet = $WhoisParser->getResult(); 89 | /** 90 | if (isset($ResultSet->network->contact->admin)) { 91 | $admin = trim($ResultSet->network->contact->admin); 92 | unset($ResultSet->network->contact->admin); 93 | $WhoisParser->call($admin); 94 | $ResultSet->contacts->admin = $ResultSet->contact; 95 | } 96 | 97 | if (isset($ResultSet->network->contact->tech)) { 98 | $tech = trim($ResultSet->network->contact->tech); 99 | unset($ResultSet->network->contact->tech); 100 | $WhoisParser->call($tech); 101 | $ResultSet->contacts->tech = $ResultSet->contact; 102 | } 103 | 104 | unset($ResultSet->contact);*/ 105 | } 106 | } -------------------------------------------------------------------------------- /Templates/Br.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)[\n]{2}/is', 47 | 2 => '/nic-hdl-br:(?>[\x20\t]*)(.*?)([\n]{2}|$)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 57 | '/^owner-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:owner', 58 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 59 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 60 | '/^billing-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:zone', 61 | '/^nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 62 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'created', 63 | '/^expires:(?>[\x20\t]*)(.+)$/im' => 'expires', 64 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'changed'), 65 | 2 => array('/^nic-hdl-br:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 66 | '/^person:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 67 | '/^e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 68 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'contacts:created', 69 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'contacts:changed')); 70 | 71 | /** 72 | * RegEx to check availability of the domain name 73 | * 74 | * @var string 75 | * @access protected 76 | */ 77 | protected $available = '/(No match for domain|release process: reserved)/i'; 78 | 79 | 80 | public function translateRawData($rawdata) 81 | { 82 | return utf8_encode($rawdata); 83 | } 84 | } -------------------------------------------------------------------------------- /Templates/Buzz: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)(?=>>>)/is'); 47 | 48 | /** 49 | * Items for each block 50 | * 51 | * @var array 52 | * @access protected 53 | */ 54 | protected $blockItems = array( 55 | 1 => array('/whois server:(?>[\x20\t]*)(.+)$/im' => 'whoisserver', 56 | '/registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 57 | '/registrar iana id:(?>[\x20\t]*)(.+)$/im' => 'registrar:id', 58 | '/referral url:(?>[\x20\t]*)(.+)$/im' => 'registrar:url', 59 | '/creation date:(?>[\x20\t]*)(.+)$/im' => 'created', 60 | '/expiry date:(?>[\x20\t]*)(.+)$/im' => 'expires', 61 | '/updated date:(?>[\x20\t]*)(.+)$/im' => 'changed', 62 | '/name server:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 63 | '/dnssec:(?>[\x20\t]*)(.+)$/im' => 'dnssec', 64 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status') 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /Templates/By.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)$/is'); 47 | 48 | /** 49 | * Items for each block 50 | * 51 | * @var array 52 | * @access protected 53 | */ 54 | protected $blockItems = array( 55 | 1 => array('/registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 56 | '/name server:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 57 | '/updated date:(?>[\x20\t]*)(.+)$/im' => 'changed', 58 | '/creation date:(?>[\x20\t]*)(.+)$/im' => 'created', 59 | '/expiration date:(?>[\x20\t]*)(.+)$/im' => 'expires')); 60 | 61 | /** 62 | * RegEx to check availability of the domain name 63 | * 64 | * @var string 65 | * @access protected 66 | */ 67 | protected $available = '/Object does not exist/i'; 68 | } -------------------------------------------------------------------------------- /Templates/Club.php: -------------------------------------------------------------------------------- 1 | '/created by registrar(.*?)(?=name value pair)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array( 57 | '/^domain expiration date:(?>[\x20\t]*)(.+)$/im' => 'expires' 58 | ) 59 | ); 60 | } -------------------------------------------------------------------------------- /Templates/Comua.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)(?=\% registrar)/is'); 47 | 48 | /** 49 | * Items for each block 50 | * 51 | * @var array 52 | * @access protected 53 | */ 54 | protected $blockItems = array( 55 | 1 => array('/expires:(?>[\x20\t]*)(.+)$/im' => 'expires', 56 | '/nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 57 | '/admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 58 | '/tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 59 | '/created:(?>[\x20\t]*)(.+)$/im' => 'created', 60 | '/changed:(?>[\x20\t]*)(.+)$/im' => 'changed')); 61 | 62 | /** 63 | * RegEx to check availability of the domain name 64 | * 65 | * @var string 66 | * @access protected 67 | */ 68 | protected $available = '/No entries found for/i'; 69 | } -------------------------------------------------------------------------------- /Templates/Dk.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)(?=registrant)/is', 47 | 2 => '/registrant\n(.*?)(?=administrator)/is', 48 | 3 => '/administrator\n(.*?)(?=nameservers)/is', 4 => '/nameservers\n(.*?)$/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/registered:(?>[\x20\t]*)(.+)$/im' => 'created', 58 | '/expires:(?>[\x20\t]*)(.+)$/im' => 'expires', 59 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status'), 60 | 2 => array('/handle:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 61 | '/name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 62 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address', 63 | '/postalcode:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:zipcode', 64 | '/city:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:city', 65 | '/country:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:country', 66 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:phone'), 67 | 3 => array('/handle:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:handle', 68 | '/name:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:name', 69 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:address', 70 | '/postalcode:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:zipcode', 71 | '/city:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:city', 72 | '/country:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:country', 73 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:phone'), 74 | 4 => array('/hostname:(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 75 | 76 | /** 77 | * RegEx to check availability of the domain name 78 | * 79 | * @var string 80 | * @access protected 81 | */ 82 | protected $available = '/No entries found for the selected source/i'; 83 | } -------------------------------------------------------------------------------- /Templates/Dz.php: -------------------------------------------------------------------------------- 1 | '/contact administratif#(?>[\. ]*)(.*?)(?=contact technique)/is', 47 | 2 => '/contact technique#(?>[\. ]*)(.*?)(?=-----------|$)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/contact administratif#(?>[\. ]*)(.+)$/im' => 'contacts:owner:name', 57 | '/organisme administratif#(?>[\. ]*)(.+)$/im' => 'contacts:owner:organization', 58 | '/adresse contact administratif#(?>[\. ]*)(.+)$/im' => 'contacts:owner:address', 59 | '/telephone contact administratif#(?>[\. ]*)(.+)$/im' => 'contacts:owner:phone', 60 | '/fax contact administratif#(?>[\. ]*)(.+)$/im' => 'contacts:owner:fax', 61 | '/mail contact administratif#(?>[\. ]*)(.+)$/im' => 'contacts:owner:email'), 62 | 2 => array('/contact technique#(?>[\. ]*)(.+)$/im' => 'contacts:tech:name', 63 | '/organisme technique#(?>[\. ]*)(.+)$/im' => 'contacts:tech:organization', 64 | '/adresse contact technique#(?>[\. ]*)(.+)$/im' => 'contacts:tech:address', 65 | '/telephone contact technique#(?>[\. ]*)(.+)$/im' => 'contacts:tech:phone', 66 | '/fax contact technique#(?>[\. ]*)(.+)$/im' => 'contacts:tech:fax', 67 | '/mail contact technique#(?>[\. ]*)(.+)$/im' => 'contacts:tech:email', 68 | '/registrar#(?>[\. ]*)(.+)$/im' => 'registrar:name', 69 | '/date de creation#(?>[\. ]*)(.+)$/im' => 'created')); 70 | 71 | /** 72 | * RegEx to check availability of the domain name 73 | * 74 | * @var string 75 | * @access protected 76 | */ 77 | protected $available = '/NO OBJECT FOUND/i'; 78 | } -------------------------------------------------------------------------------- /Templates/Ee.php: -------------------------------------------------------------------------------- 1 | '/domain:(.*?)(?=expire)/is', 2 => '/nsset:(.*?)(?=created)/is', 47 | 3 => '/contact:(.*?)(?=created)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/status:(?>[\x20\t]*)(.+)$/im' => 'status', 57 | '/changed:(?>[\x20\t]*)(.+)$/im' => 'changed', 58 | '/expire:(?>[\x20\t]*)(.+)$/im' => 'expires', 59 | '/registered:(?>[\x20\t]*)(.+)$/im' => 'created', 60 | '/registrant:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:owner', 61 | '/admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin'), 62 | 63 | 2 => array('/nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 64 | '/tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech'), 65 | 66 | 3 => array('/contact:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 67 | '/org:(?>[\x20\t]*)(.+)$/im' => 'contacts:organization', 68 | '/e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 69 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 70 | '/fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax', 71 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:address', 72 | '/name:(?>[\x20\t]*)(.+)$/im' => 'contacts:name')); 73 | 74 | /** 75 | * RegEx to check availability of the domain name 76 | * 77 | * @var string 78 | * @access protected 79 | */ 80 | protected $available = '/No entries found/i'; 81 | } -------------------------------------------------------------------------------- /Templates/Email.php: -------------------------------------------------------------------------------- 1 | '/domain name:(.*?)(?=registrant id)/is' 48 | ); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array( 58 | '/^registry expiry date:(.+)$/im' => 'expires' 59 | ) 60 | ); 61 | } -------------------------------------------------------------------------------- /Templates/Es.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)(?=registrant:)/is', 47 | 2 => '/registrant name:(?>[\x20\t]*)(.*?)(?=domain servers)/is', 48 | 3 => '/domain servers:(?>[\x20\t]*)(.*?)(?=\>\>\> last update)/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/creation date:(?>[\x20\t]*)(.+)$/im' => 'created', 58 | '/expiration date:(?>[\x20\t]*)(.+)$/im' => 'expires'), 59 | 2 => array('/registrant name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name'), 60 | 3 => array('/name server [0-9]:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 61 | '/ipv4 server [0-9]:(?>[\x20\t]*)(.+)$/im' => 'ips')); 62 | 63 | /** 64 | * RegEx to check availability of the domain name 65 | * 66 | * @var string 67 | * @access protected 68 | */ 69 | protected $available = '/there is no information available on/i'; 70 | } -------------------------------------------------------------------------------- /Templates/Eu.php: -------------------------------------------------------------------------------- 1 | '/technical:\n(.*?)(?=registrar)/is', 47 | 2 => '/registrar:\n(.*?)(?=name servers)/is', 3 => '/name servers:\n(.*?)(?=keys:)/is', 48 | 4 => '/keys:\n(.*?)(?=Please visit)/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 58 | '/organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:organization', 59 | '/language:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:language', 60 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone', 61 | '/fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:fax', 62 | '/email:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:email'), 63 | 2 => array('/name:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 64 | '/website:(?>[\x20\t]*)(.+)$/im' => 'registrar:url'), 65 | 3 => array('/\n(?>[\x20\t]+)(.+)$/im' => 'nameserver', 66 | '/\n(?>[\x20\t]+)(.+) \(.+\)$/im' => 'nameserver', 67 | '/\n(?>[\x20\t]+).+ \((.+)\)$/im' => 'ips'), 68 | 4 => array('/keyTag:(.+)$/im' => 'dnssec')); 69 | 70 | /** 71 | * RegEx to check availability of the domain name 72 | * 73 | * @var string 74 | * @access protected 75 | */ 76 | protected $available = '/Status:(?>[\x20\t]*)AVAILABLE/i'; 77 | 78 | /** 79 | * After parsing ... 80 | * 81 | * If dnssec key was found we set attribute to true 82 | * 83 | * @param object &$WhoisParser 84 | * @return void 85 | */ 86 | public function postProcess(&$WhoisParser) 87 | { 88 | $ResultSet = $WhoisParser->getResult(); 89 | 90 | if ($ResultSet->dnssec != '') { 91 | $ResultSet->dnssec = true; 92 | } else { 93 | $ResultSet->dnssec = false; 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /Templates/Fi.php: -------------------------------------------------------------------------------- 1 | '/status:(?>[\x20\t]*)(.*?)(?=more information is)/is', 47 | 2 => '/descr:(?>[\x20\t]*)(.*?)(?=status)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/created:(?>[\x20\t]*)(.+)$/im' => 'created', 57 | '/modified:(?>[\x20\t]*)(.+)$/im' => 'changed', 58 | '/expires:(?>[\x20\t]*)(.+)$/im' => 'expires', 59 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status', 60 | '/dnssec:(?>[\x20\t]*)(.+)$/im' => 'dnssec', 61 | '/nserver:(?>[\x20\t]*)(.+) \[.+\]$/im' => 'nameserver'), 62 | 2 => array('/descr:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', 63 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address', 64 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:phone')); 65 | 66 | /** 67 | * RegEx to check availability of the domain name 68 | * 69 | * @var string 70 | * @access protected 71 | */ 72 | protected $available = '/domain not found/i'; 73 | 74 | /** 75 | * After parsing ... 76 | * 77 | * If dnssec key was found we set attribute to true. Furthermore 78 | * we have to fix the owner address, because the WHOIS output is not 79 | * well formed. 80 | * 81 | * @param object &$WhoisParser 82 | * @return void 83 | */ 84 | public function postProcess(&$WhoisParser) 85 | { 86 | $ResultSet = $WhoisParser->getResult(); 87 | 88 | if ($ResultSet->dnssec !== 'no') { 89 | $ResultSet->dnssec = true; 90 | } else { 91 | $ResultSet->dnssec = false; 92 | } 93 | 94 | foreach ($ResultSet->contacts as $contactType => $contactArray) { 95 | foreach ($contactArray as $contactObject) { 96 | $contactObject->organization = utf8_encode($contactObject->organization[0]); 97 | $contactObject->name = $contactObject->address[0]; 98 | $contactObject->zipcode = $contactObject->address[2]; 99 | $contactObject->city = $contactObject->address[3]; 100 | $contactObject->address = $contactObject->address[1]; 101 | } 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /Templates/Fj.php: -------------------------------------------------------------------------------- 1 | '/Status:(?>[\x20\t]*)(.*?)(?=Registrant)/is', 47 | 2 => '/Registrant:\n(?>[\x20\t]*)(.*?)(?=Domain servers)/is', 48 | 3 => '/Domain servers:\n(?>[\x20\t]*)(.*?)$/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/Status:(?>[\x20\t]*)(.+)/im' => 'status', 58 | '/Expires:(?>[\x20\t]*)(.+)$/im' => 'expires'), 59 | 2 => array('/Registrant:\n(?>[\x20\t]*)(.+)$/is' => 'contacts:owner:address'), 60 | 3 => array('/\n(?>[\x20\t]+)(.+) .+$/im' => 'nameserver', 61 | '/\n(?>[\x20\t]+).+ (.+)$/im' => 'ips')); 62 | 63 | /** 64 | * RegEx to check availability of the domain name 65 | * 66 | * @var string 67 | * @access protected 68 | */ 69 | protected $available = '/was not found/i'; 70 | 71 | /** 72 | * After parsing do something 73 | * 74 | * Fix address 75 | * 76 | * @param object &$WhoisParser 77 | * @return void 78 | */ 79 | public function postProcess(&$WhoisParser) 80 | { 81 | $ResultSet = $WhoisParser->getResult(); 82 | 83 | if (isset($ResultSet->contacts->owner[0]->address)) { 84 | $filteredAddress = array_map('trim', explode("\n", trim($ResultSet->contacts->owner[0]->address))); 85 | 86 | $ResultSet->contacts->owner[0]->name = $filteredAddress[0]; 87 | $ResultSet->contacts->owner[0]->address = $filteredAddress[1]; 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /Templates/Fo.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)(?=contact)/is', 47 | 2 => '/nserver:(?>[\x20\t]*)(.*?)$/is', 3 => '/contact:(?>[\x20\t]*)(.*?)(?=nserver)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/registered:(?>[\x20\t]*)(.+)$/im' => 'created', 57 | '/changed:(?>[\x20\t]*)(.+)$/im' => 'changed', 58 | '/expire:(?>[\x20\t]*)(.+)$/im' => 'expires', 59 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status'), 60 | 2 => array('/nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 61 | '/tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech'), 62 | 3 => array('/contact:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 63 | '/org:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', 64 | '/street:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address', 65 | '/city:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:city', 66 | '/postal code:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:zipcode', 67 | '/country:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:country', 68 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:phone', 69 | '/created:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:created')); 70 | 71 | /** 72 | * RegEx to check availability of the domain name 73 | * 74 | * @var string 75 | * @access protected 76 | */ 77 | protected $available = '/No entries found./i'; 78 | } -------------------------------------------------------------------------------- /Templates/Gtld_deutschetelekom.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)(?=nic-hdl\:)/is', 47 | 2 => '/nic-hdl:(?>[\x20\t]*)(.*?)[\n]{2}/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 57 | '/^registrant-hdl:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:owner', 58 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 59 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 60 | '/^zone-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:zone', 61 | '/^nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 62 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'created', 63 | '/^expires:(?>[\x20\t]*)(.+)$/im' => 'expires', 64 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'changed'), 65 | 2 => array('/^nic-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 66 | '/^type:(?>[\x20\t]*)(.+)$/im' => 'contacts:type', 67 | '/^title:(?>[\x20\t]*)(.+)$/im' => 'contacts:title', 68 | '/^name of the organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:organization', 69 | '/^(first|last)name:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 70 | '/^address:(?>[\x20\t]*)(.+)$/im' => 'contacts:address', 71 | '/^city:(?>[\x20\t]*)(.+)$/im' => 'contacts:city', 72 | '/^state:(?>[\x20\t]*)(.+)$/im' => 'contacts:state', 73 | '/^pcode:(?>[\x20\t]*)(.+)$/im' => 'contacts:zipcode', 74 | '/^country:(?>[\x20\t]*)(.+)$/im' => 'contacts:country', 75 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 76 | '/^fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax', 77 | '/^e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 78 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'contacts:changed')); 79 | } -------------------------------------------------------------------------------- /Templates/Gtld_joker.php: -------------------------------------------------------------------------------- 1 | '/owner:(?>[\x20\t]*)(.*?)(?=contact-hdl)/is', 47 | 2 => '/contact-hdl:(?>[\x20\t]*)(.*?)(?=contact-hdl|source)/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^owner:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 57 | '/^organization:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', 58 | '/^email:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:email', 59 | '/^address:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address', 60 | '/^city:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:city', 61 | '/^postal-code:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:zipcode', 62 | '/^owner-country:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:country', 63 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:phone', 64 | '/^admin-c:(?>[\x20\t]*)(.+) .+$/im' => 'network:contacts:admin', 65 | '/^tech-c:(?>[\x20\t]*)(.+) .+$/im' => 'network:contacts:tech', 66 | '/^billing-c:(?>[\x20\t]*)(.+) .+$/im' => 'network:contacts:billing'), 67 | 2 => array('/^contact-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 68 | '/^person:(?>[\x20\t]*)(.+)$/im' => 'contacts:organization', 69 | '/^organization:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 70 | '/^email:(?>[\x20\t]*)(.+)$/im' => 'contacts:address', 71 | '/^address:(?>[\x20\t]*)(.+)$/im' => 'contacts:city', 72 | '/^city:(?>[\x20\t]*)(.+)$/im' => 'contacts:state', 73 | '/^postal-code:(?>[\x20\t]*)(.+)$/im' => 'contacts:zipcode', 74 | '/^country:(?>[\x20\t]*)(.+)$/im' => 'contacts:country', 75 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone')); 76 | } -------------------------------------------------------------------------------- /Templates/Gtld_markmonitor.php: -------------------------------------------------------------------------------- 1 | '/Registrant:(.*?)(?=Domain Name:)/is', 47 | 2 => '/Administrative Contact:(.*)(?=Technical Contact)/is', 48 | 3 => '/Technical Contact(, Zone Contact)?:(.*?)(?=Created on)/is', 49 | 4 => '/Zone Contact:(.*?)(?=Created on)/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array(1 => array('/Registrant:(.*?)$/is' => 'contacts:owner:address'), 58 | 2 => array('/Administrative Contact:(.*)$/is' => 'contacts:admin:address'), 59 | 3 => array('/Technical Contact(, Zone Contact)?:(.*?)$/is' => 'contacts:tech:address'), 60 | 4 => array('/Zone Contact:(.*?)$/is' => 'contacts:zone:address')); 61 | 62 | /** 63 | * After parsing do something 64 | * 65 | * Fix address 66 | * 67 | * @param object &$WhoisParser 68 | * @return void 69 | */ 70 | public function postProcess(&$WhoisParser) 71 | { 72 | $ResultSet = $WhoisParser->getResult(); 73 | 74 | foreach ($ResultSet->contacts as $contactType => $contactArray) { 75 | foreach ($contactArray as $contactObject) { 76 | $filteredAddress = array_map('trim', explode("\n", trim($contactObject->address))); 77 | 78 | $contactObject->name = $filteredAddress[0]; 79 | $contactObject->organization = $filteredAddress[1]; 80 | $contactObject->city = $filteredAddress[3]; 81 | $contactObject->country = $filteredAddress[4]; 82 | $contactObject->address = $filteredAddress[2]; 83 | 84 | $lastEntries = explode(' ', $filteredAddress[5]); 85 | 86 | $contactObject->email = $lastEntries[0]; 87 | $contactObject->phone = $lastEntries[1]; 88 | 89 | if (isset($lastEntries[3])) { 90 | $contactObject->fax = $lastEntries[3]; 91 | } 92 | } 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /Templates/Gtld_psiusa.php: -------------------------------------------------------------------------------- 1 | '/^domain:(?>[\x20\t]*)(.+)[\n]{2}$/ims', 47 | 2 => '/\[(admin|owner|tech|zone)-c\]\x20handle:(?>[\x20\t]*)(.*?)[\n]{2}/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 57 | '/^owner-c:(?>[\x20\t]*)LULU-(.+)$/im' => 'network:contacts:owner', 58 | '/^admin-c:(?>[\x20\t]*)LULU-(.+)$/im' => 'network:contacts:admin', 59 | '/^tech-c:(?>[\x20\t]*)LULU-(.+)$/im' => 'network:contacts:tech', 60 | '/^zone-c:(?>[\x20\t]*)LULU-(.+)$/im' => 'network:contacts:zone', 61 | '/^nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 62 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'created', 63 | '/^expire:(?>[\x20\t]*)(.+)$/im' => 'expires', 64 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'changed'), 65 | 2 => array( 66 | '/^\[(owner|admin|tech|zone)-c\]\x20handle:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 67 | '/^\[(owner|admin|tech|zone)-c\]\x20type:(?>[\x20\t]*)(.+)$/im' => 'contacts:type', 68 | '/^\[(owner|admin|tech|zone)-c\]\x20title:(?>[\x20\t]*)(.+)$/im' => 'contacts:title', 69 | '/^\[(owner|admin|tech|zone)-c\]\x20org:(?>[\x20\t]*)(.+)$/im' => 'contacts:organization', 70 | '/^\[(owner|admin|tech|zone)-c\]\x20(f|l)name:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 71 | '/^\[(owner|admin|tech|zone)-c\]\x20address:(?>[\x20\t]*)(.+)$/im' => 'contacts:address', 72 | '/^\[(owner|admin|tech|zone)-c\]\x20city:(?>[\x20\t]*)(.+)$/im' => 'contacts:city', 73 | '/^\[(owner|admin|tech|zone)-c\]\x20state:(?>[\x20\t]*)(.+)$/im' => 'contacts:state', 74 | '/^\[(owner|admin|tech|zone)-c\]\x20pcode:(?>[\x20\t]*)(.+)$/im' => 'contacts:zipcode', 75 | '/^\[(owner|admin|tech|zone)-c\]\x20country:(?>[\x20\t]*)(.+)$/im' => 'contacts:country', 76 | '/^\[(owner|admin|tech|zone)-c\]\x20phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 77 | '/^\[(owner|admin|tech|zone)-c\]\x20fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax', 78 | '/^\[(owner|admin|tech|zone)-c\]\x20email:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 79 | '/^\[(owner|admin|tech|zone)-c\]\x20updated:(?>[\x20\t]*)(.+)$/im' => 'contacts:changed')); 80 | } -------------------------------------------------------------------------------- /Templates/Gtld_rf.php: -------------------------------------------------------------------------------- 1 | '/^domain$/i', 12 | 'created' => '/^created$/i', 13 | 'expires' => '/^paid-till$/i', 14 | 'nameserver' => '/^nserver$/i', 15 | 'status' => '/^state$/i', 16 | // Registrar 17 | 'registrar:id' => '/^registrar$/i', 18 | // Contacts: Owner 19 | 'contacts:owner:name' => '/^person$/i', 20 | 'contacts:owner:organization' => '/^org$/i', 21 | 'contacts:owner:phone' => '/^phone$/i', 22 | 'contacts:owner:fax' => '/^fax$/i', 23 | 'contacts:owner:email' => '/^e-mail$/i', 24 | ); 25 | 26 | protected $available = '/No entries found/i'; 27 | 28 | 29 | public function reformatData() 30 | { 31 | if (array_key_exists('state', $this->data) && (! is_array($this->data['state']))) { 32 | $this->data['state'] = explode(', ', $this->data['state']); 33 | } 34 | 35 | $dateFields = ['created', 'free-date', 'paid-till']; 36 | foreach ($dateFields as $field) { 37 | if (array_key_exists($field, $this->data)) { 38 | $this->data[$field] = str_replace('.', '-', $this->data[$field]); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Templates/Hu.php: -------------------------------------------------------------------------------- 1 | data) && strlen($this->data[$field])) { 20 | $this->data[$field] = str_replace('.', '-', $this->data[$field]); 21 | } 22 | } 23 | } 24 | 25 | 26 | public function translateRawData($rawdata, $config) 27 | { 28 | return utf8_encode($rawdata); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Templates/Ie.php: -------------------------------------------------------------------------------- 1 | '/descr:(?>[\x20\t]*)(.*?)(?=person)/is', 47 | 2 => '/person:(?>[\x20\t]*).*?[\n]{2}/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^descr:(?>[\x20\t]*)(.+)\n/i' => 'contacts:owner:name', 57 | '/admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 58 | '/tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 59 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status', 60 | '/nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 61 | '/registration:(?>[\x20\t]*)(.+)$/im' => 'created', 62 | '/renewal:(?>[\x20\t]*)(.+)$/im' => 'expires'), 63 | 64 | 2 => array('/nic-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 65 | '/person:(?>[\x20\t]*)(.+)$/im' => 'contacts:name')); 66 | 67 | /** 68 | * RegEx to check availability of the domain name 69 | * 70 | * @var string 71 | * @access protected 72 | */ 73 | protected $available = '/Not Registered/i'; 74 | } -------------------------------------------------------------------------------- /Templates/Int.php: -------------------------------------------------------------------------------- 1 | '/organisation:(?>[\x20\t]*)(.*?)(?=contact:)/is', 47 | 2 => '/contact:(?>[\x20\t]*)administrative(.*?)(?=contact)/is', 48 | 3 => '/contact:(?>[\x20\t]*)technical(.*?)(?=nserver)/is', 49 | 4 => '/nserver:(?>[\x20\t]*)(.*?)$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', 59 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address'), 60 | 2 => array('/name:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:name', 61 | '/organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:organization', 62 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:address', 63 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:phone', 64 | '/fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:fax', 65 | '/e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:email'), 66 | 3 => array('/name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 67 | '/organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:organization', 68 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:address', 69 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone', 70 | '/fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:fax', 71 | '/e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:email'), 72 | 4 => array('/nserver:(?>[\x20\t]*)([a-z0-9\.]*) [a-z0-9\.\:]*/im' => 'nameserver', 73 | '/nserver:(?>[\x20\t]*)[a-z0-9\.]* ([a-z0-9\.\:]*)/im' => 'ips', 74 | '/created:(?>[\x20\t]*)(.+)$/im' => 'created')); 75 | 76 | /** 77 | * RegEx to check availability of the domain name 78 | * 79 | * @var string 80 | * @access protected 81 | */ 82 | protected $available = '/but this server does not have/i'; 83 | } -------------------------------------------------------------------------------- /Templates/Ir.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)(?=source)/is', 47 | 2 => '/nic-hdl:(?>[\x20\t]*).*?[\n]{2}/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 57 | '/^last-updated:(?>[\x20\t]*)(.+)$/im' => 'changed', 58 | '/^expire-date:(?>[\x20\t]*)(.+)$/im' => 'expires', 59 | '/^holder-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:owner', 60 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 61 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech'), 62 | 63 | 2 => array('/^nic-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 64 | '/^org:(?>[\x20\t]*)(.+)$/im' => 'contacts:organization', 65 | '/^e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 66 | '/^address:(?>[\x20\t]*)(.+)$/im' => 'contacts:address', 67 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 68 | '/^fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax')); 69 | 70 | /** 71 | * RegEx to check availability of the domain name 72 | * 73 | * @var string 74 | * @access protected 75 | */ 76 | protected $available = '/no entries found/i'; 77 | } -------------------------------------------------------------------------------- /Templates/Jp.php: -------------------------------------------------------------------------------- 1 | '/\[(registrant|organization)\](?>[\x20\t]*)(.*?)$/im', 47 | 2 => '/\[name server\](?>[\x20\t]*)(.*?)(?=contact information:|$)/is', 48 | 3 => '/contact information:(?>[\x20\t]*)(.*?)$/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array( 58 | '/\[(registrant|organization)\](?>[\x20\t]*)(.*?)$/im' => 'contacts:owner:organization'), 59 | 2 => array('/\[name server\](?>[\x20\t]*)(.+)$/im' => 'nameserver', 60 | '/\[signing key\](?>[\x20\t]*)(.+)$/im' => 'dnssec', 61 | '/\[(created on|registered date)\](?>[\x20\t]*)(.+)$/im' => 'created', 62 | '/\[expires on\](?>[\x20\t]*)(.+)$/im' => 'expires', 63 | '/\[(status|state)\](?>[\x20\t]*)(.+)$/im' => 'status', 64 | '/\[last (update|updated)\](?>[\x20\t]*)(.+)$/im' => 'changed'), 65 | 3 => array('/\[name\](?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 66 | '/\[email\](?>[\x20\t]*)(.+)$/im' => 'contacts:owner:email', 67 | '/\[postal code\](?>[\x20\t]*)(.+)$/im' => 'contacts:owner:zipcode', 68 | '/^(\[postal address\])?(?>[\x20\t]+)(.+)$/im' => 'contacts:owner:address', 69 | '/\[phone\](?>[\x20\t]*)(.+)$/im' => 'contacts:owner:phone', 70 | '/\[fax\](?>[\x20\t]*)(.+)$/im' => 'contacts:owner:fax')); 71 | 72 | /** 73 | * RegEx to check availability of the domain name 74 | * 75 | * @var string 76 | * @access protected 77 | */ 78 | protected $available = '/No match!!/i'; 79 | 80 | /** 81 | * After parsing ... 82 | * 83 | * If dnssec key was found we set attribute to true. 84 | * 85 | * @param object &$WhoisParser 86 | * @return void 87 | */ 88 | public function postProcess(&$WhoisParser) 89 | { 90 | $ResultSet = $WhoisParser->getResult(); 91 | 92 | if ($ResultSet->dnssec != '') { 93 | $ResultSet->dnssec = true; 94 | } else { 95 | $ResultSet->dnssec = false; 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /Templates/Kr.php: -------------------------------------------------------------------------------- 1 | '/Registrant(?>[\x20\t]*):(?>[\x20\t]*)(.*?)(?=Administrative Contact)/is', 48 | 2 => '/Administrative Contact\(AC\)(?>[\x20\t]*):(?>[\x20\t]*)(.*?)(?=Registered Date)/is', 49 | 3 => '/Registered Date(?>[\x20\t]*):(?>[\x20\t]*)(.*?)(?=Primary Name Server)/is', 50 | 4 => '/Primary Name Server(.*?)$/is'); 51 | 52 | /** 53 | * Items for each block 54 | * 55 | * @var array 56 | * @access protected 57 | */ 58 | protected $blockItems = array( 59 | 1 => array('/^Registrant(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 60 | '/^Registrant Address(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address', 61 | '/^Registrant Zip Code(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:zipcode'), 62 | 2 => array( 63 | '/^Administrative Contact\(AC\)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:name', 64 | '/^AC E-Mail(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:email', 65 | '/^AC Phone Number(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:phone'), 66 | 3 => array('/^Registered Date(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'created', 67 | '/^Last updated Date(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'changed', 68 | '/^Expiration Date(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'expires', 69 | '/^Publishes(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'status', 70 | '/^Authorized Agency(?>[\x20\t]*):(?>[\x20\t]*)(.+)\(.+\)$/im' => 'registrar:name', 71 | '/^Authorized Agency(?>[\x20\t]*):(?>[\x20\t]*).+\((.+)\)$/im' => 'registrar:url'), 72 | 4 => array('/(?>[\x20\t]*)Host Name(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 73 | 74 | /** 75 | * RegEx to check availability of the domain name 76 | * 77 | * @var string 78 | * @access protected 79 | */ 80 | protected $available = '/Above domain name is not registered/i'; 81 | 82 | /** 83 | * After parsing ... 84 | * 85 | * Fix address dates 86 | * 87 | * @param object &$WhoisParser 88 | * @return void 89 | */ 90 | public function postProcess(&$WhoisParser) 91 | { 92 | $ResultSet = $WhoisParser->getResult(); 93 | 94 | $ResultSet->created = str_replace('. ', '-', $ResultSet->created); 95 | $ResultSet->changed = str_replace('. ', '-', $ResultSet->changed); 96 | $ResultSet->expires = str_replace('. ', '-', $ResultSet->expires); 97 | } 98 | } -------------------------------------------------------------------------------- /Templates/Krnic.php: -------------------------------------------------------------------------------- 1 | '/(\[ Network Information \])[\n]{1}(.*?)[\n]{2}/is', 47 | 2 => '/(\[ Admin Contact Information \])[\n]{1}(.*?)[\n]{2}/is', 48 | 3 => '/(\[ Tech Contact Information \])[\n]{1}(.*?)[\n]{2}/is', 49 | 4 => '/(\[ Network Abuse Contact Information \])[\n]{1}(.*?)[\n]{2}/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/^IPv4 Address[\s]*:[\s]*(.+)$/im' => 'network:inetnum', 59 | '/^IPv6 Address[\s]*:[\s]*(.+)$/im' => 'network:inetnum', 60 | '/^Service Name[\s]*:[\s]*(.+)$/im' => 'network:name', 61 | '/^Organization ID[\s]*:[\s]*(.+)$/im' => 'contacts:owner:handle', 62 | '/^Organization Name[\s]*:[\s]*(.+)$/im' => 'contacts:owner:name', 63 | '/^Address[\s]*:[\s]*(.+)$/im' => 'contacts:owner:address', 64 | '/^Zip Code[\s]*:[\s]*(.+)$/im' => 'contacts:owner:zipcode', 65 | '/^Registration Date[\s]*:[\s]*(.+)$/im' => 'created'), 66 | 67 | 2 => array('/^Name[\s]*:[\s]*(.+)$/im' => 'contacts:admin:name', 68 | '/^Phone[\s]*:[\s]*(.+)$/im' => 'contacts:admin:phone', 69 | '/^E-Mail[\s]*:[\s]*(.+)$/im' => 'contacts:admin:email'), 70 | 71 | 3 => array('/^Name[\s]*:[\s]*(.+)$/im' => 'contacts:tech:name', 72 | '/^Phone[\s]*:[\s]*(.+)$/im' => 'contacts:tech:phone', 73 | '/^E-Mail[\s]*:[\s]*(.+)$/im' => 'contacts:tech:email'), 74 | 75 | 4 => array('/^Name[\s]*:[\s]*(.+)$/im' => 'contacts:abuse:name', 76 | '/^Phone[\s]*:[\s]*(.+)$/im' => 'contacts:abuse:phone', 77 | '/^E-Mail[\s]*:[\s]*(.+)$/im' => 'contacts:abuse:email')); 78 | } -------------------------------------------------------------------------------- /Templates/Kz.php: -------------------------------------------------------------------------------- 1 | '/Organization Using Domain Name(.*?)(?=Administrative Contact\/Agent)/is', 48 | 2 => '/Administrative Contact\/Agent(.*?)(?=Nameserver in listed order)/is', 49 | 3 => '/Nameserver in listed order(.*?)(?=Domain created)/is', 50 | 4 => '/Domain created(.*?)$/is'); 51 | 52 | /** 53 | * Items for each block 54 | * 55 | * @var array 56 | * @access protected 57 | */ 58 | protected $blockItems = array( 59 | 1 => array( 60 | '/^Name(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 61 | '/^Organization Name(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', 62 | '/^Street Address(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address', 63 | '/^City(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.*)$/im' => 'contacts:owner:city', 64 | '/^State(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.*)$/im' => 'contacts:owner:state', 65 | '/^Postal Code(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.*)$/im' => 'contacts:owner:zipcode', 66 | '/^City(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.*)$/im' => 'contacts:owner:city'), 67 | 2 => array( 68 | '/^NIC Handle(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:handle', 69 | '/^Name(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.*)$/im' => 'contacts:admin:name', 70 | '/^Phone Number(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:phone', 71 | '/^Fax Number(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:fax', 72 | '/^Email Address(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:email'), 73 | 3 => array( 74 | '/^(Primary|Secondary) server(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'nameserver', 75 | '/^(Primary|Secondary) ip address(?>[\.]*)(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'ips'), 76 | 4 => array('/^Last modified(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'changed', 77 | '/^Domain created(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'created', 78 | '/^Domain status(?>[\x20\t]*):(?>[\x20\t]*)(.+)$/im' => 'status')); 79 | 80 | /** 81 | * RegEx to check availability of the domain name 82 | * 83 | * @var string 84 | * @access protected 85 | */ 86 | protected $available = '/Nothing found for this query/i'; 87 | } -------------------------------------------------------------------------------- /Templates/Lacnic.php: -------------------------------------------------------------------------------- 1 | '/(inetnum|inet6num):[\s]*(.*?)[\n]{2}/is', 47 | 2 => '/nic-hdl:[\s]*(.*?)[\n]{2}/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^inetnum:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 57 | '/^inet6num:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 58 | '/^netname:(?>[\x20\t]*)(.+)$/im' => 'network:name', 59 | '/^mnt-by:(?>[\x20\t]*)(.+)$/im' => 'network:maintainer', 60 | '/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 61 | '/^nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 62 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'created', 63 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'changed', 64 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 65 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 66 | '/^abuse-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:abuse', 67 | '/^owner-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:owner'), 68 | 69 | 2 => array('/^organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 70 | '/^org:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 71 | '/^nic-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 72 | '/^org-name:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 73 | '/^role:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 74 | '/^person:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 75 | '/^address:(?>[\x20\t]*)(.+)/im' => 'contacts:address', 76 | '/^abuse-mailbox:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 77 | '/^e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 78 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 79 | '/^fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax', 80 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'contacts:created', 81 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'contacts:changed')); 82 | } -------------------------------------------------------------------------------- /Templates/Link.php: -------------------------------------------------------------------------------- 1 | '/domain name:(.*?)(?=registrant id)/is' 48 | ); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array( 58 | '/^registry expiry date:(.+)$/im' => 'expires' 59 | ) 60 | ); 61 | } -------------------------------------------------------------------------------- /Templates/Lt.php: -------------------------------------------------------------------------------- 1 | '/Domain:(?>[\x20\t]*)(.*?)(?=Registrar:)/is', 47 | 2 => '/Registrar:(?>[\x20\t]*)(.*?)(?=Contact (name|organization))/is', 48 | 3 => '/Contact (name|organization):(?>[\x20\t]*)(.*?)(?=Contact (name|organization)|Nameserver)/is', 49 | 4 => '/Nameserver:(?>[\x20\t]*)(.*?)$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/^Status:(?>[\x20\t]*)(.+)$/im' => 'status', 59 | '/^Registered:(?>[\x20\t]*)(.+)$/im' => 'created'), 60 | 2 => array('/^Registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 61 | '/^Registrar website:(?>[\x20\t]*)(.+)$/im' => 'registrar:url', 62 | '/^Registrar email:(?>[\x20\t]*)(.+)$/im' => 'registrar:email'), 63 | 3 => array('/^Contact name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 64 | '/^Contact organization:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:organization', 65 | '/^Contact email:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:email'), 66 | 4 => array('/^Nameserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 67 | 68 | /** 69 | * RegEx to check availability of the domain name 70 | * 71 | * @var string 72 | * @access protected 73 | */ 74 | protected $available = '/available/i'; 75 | } -------------------------------------------------------------------------------- /Templates/Lv.php: -------------------------------------------------------------------------------- 1 | '/\[Domain\](.*?)(?=\[Holder\])/is', 47 | 2 => '/\[Holder\](.*?)(?=\[Tech\])/is', 48 | 3 => '/\[Tech\](.*?)(?=\[Registrar|Nservers\])/is', 49 | 4 => '/\[Registrar\](.*?)(?=\[Nservers\])/is', 5 => '/\[Nservers\].*?$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 59 | '/^changed:(?>[\x20\t]*)(.+)$/im' => 'changed'), 60 | 61 | 2 => array('/^name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 62 | '/^type:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:type', 63 | '/^email:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:email', 64 | '/^fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:fax', 65 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:phone', 66 | '/^address:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:address'), 67 | 68 | 3 => array('/^name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 69 | '/^type:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:type', 70 | '/^email:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:email', 71 | '/^fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:fax', 72 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone', 73 | '/^address:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:address'), 74 | 75 | 4 => array('/^name:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 76 | '/^email:(?>[\x20\t]*)(.+)$/im' => 'registrar:email'), 77 | 78 | 5 => array('/^Nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 79 | 80 | /** 81 | * RegEx to check availability of the domain name 82 | * 83 | * @var string 84 | * @access protected 85 | */ 86 | protected $available = '/Status: free/i'; 87 | } -------------------------------------------------------------------------------- /Templates/Md.php: -------------------------------------------------------------------------------- 1 | '/Domain name:(.*?)$/is'); 47 | 48 | /** 49 | * Items for each block 50 | * 51 | * @var array 52 | * @access protected 53 | */ 54 | protected $blockItems = array( 55 | 1 => array('/Registrant:(.*)$/im' => 'contacts:owner:name', 56 | '/Created: (.*)$/im' => 'created', '/Expiration date: (.*)$/im' => 'expires', 57 | '/Name server: (.*) .*$/im' => 'nameserver', 58 | '/Name server: .* (.*)$/im' => 'ips')); 59 | 60 | /** 61 | * RegEx to check availability of the domain name 62 | * 63 | * @var string 64 | * @access protected 65 | */ 66 | protected $available = '/No match for/i'; 67 | } -------------------------------------------------------------------------------- /Templates/Nu.php: -------------------------------------------------------------------------------- 1 | - Based on template by estshy 21 | */ 22 | 23 | /** 24 | * @namespace Novutec\Whois\Parser\Templates 25 | */ 26 | namespace Novutec\WhoisParser\Templates; 27 | 28 | use Novutec\WhoisParser\Templates\Type\Regex; 29 | 30 | /** 31 | * Template for .NU 32 | * 33 | * @category Novutec 34 | * @package WhoisParser 35 | * @copyright Copyright (c) 2007 - 2013 Novutec Inc. (http://www.novutec.com) 36 | * @license http://www.apache.org/licenses/LICENSE-2.0 37 | */ 38 | class Nu extends Regex 39 | { 40 | 41 | /** 42 | * Blocks within the raw output of the whois 43 | * 44 | * @var array 45 | * @access protected 46 | */ 47 | protected $blocks = array( 48 | 1 => '/state(.*?)$/is', 49 | ); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array( 59 | '/^nserver:(?>[\s]+)(.+)$/im' => 'nameserver', 60 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'created', 61 | '/^modified:(?>[\x20\t]*)(.+)$/im' => 'changed', 62 | '/^expires:(?>[\x20\t]*)(.+)$/im' => 'expires', 63 | '/^registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 64 | '/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 65 | '/^dnssec:(?>[\x20\t]*)(.+)$/im' => 'dnssec', 66 | 67 | '/^holder:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 68 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:handle', 69 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 70 | '/^billing-c:(?>[\x20\t]*)(.+)$/im' => 'contacts:billing:handle', 71 | ) 72 | ); 73 | 74 | /** 75 | * RegEx to check availability of the domain name 76 | * 77 | * @var string 78 | * @access protected 79 | */ 80 | protected $available = '/" not found./i'; 81 | 82 | /** 83 | * After parsing ... 84 | * 85 | * If dnssec key was found we set attribute to true. 86 | * 87 | * @param object &$WhoisParser 88 | * @return void 89 | */ 90 | public function postProcess(&$WhoisParser) 91 | { 92 | $ResultSet = $WhoisParser->getResult(); 93 | if (preg_match("/unsigned/i", $ResultSet->dnssec)) { 94 | $ResultSet->dnssec = false; 95 | } else { 96 | $ResultSet->dnssec = true; 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /Templates/Om.php: -------------------------------------------------------------------------------- 1 | '/Domain Name:(?>[\x20\t]*)(.*?)(?=Registrant Contact ID)/is', 47 | 2 => '/Registrant Contact ID:(?>[\x20\t]*)(.*?)(?=Tech Contact ID)/is', 48 | 3 => '/Tech Contact ID:(?>[\x20\t]*)(.*?)(?=Name Server)/is', 49 | 4 => '/Name Server:(?>[\x20\t]*)(.*?)$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/^Last Modified:(?>[\x20\t]*)(.+)$/im' => 'changed', 59 | '/^Registrar Name:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 60 | '/^Status:(?>[\x20\t]*)(.+)$/im' => 'status'), 61 | 2 => array('/^Registrant Contact ID:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 62 | '/^Registrant Contact Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 63 | '/^Registrant Contact City:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:city', 64 | '/^Registrant Contact Country:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:country'), 65 | 3 => array('/^Tech Contact ID:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 66 | '/^Tech Contact Name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 67 | '/^Tech Contact City:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:city', 68 | '/^Tech Contact Country:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:country'), 69 | 4 => array('/^Name Server:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 70 | '/^Name Server IP:(?>[\x20\t]*)(.+)$/im' => 'ips')); 71 | 72 | /** 73 | * RegEx to check availability of the domain name 74 | * 75 | * @var string 76 | * @access protected 77 | */ 78 | protected $available = '/No Data Found/i'; 79 | } -------------------------------------------------------------------------------- /Templates/Pl.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)(?=technical contact:|registrar:)/is', 48 | 2 => '/technical contact:(?>[\x20\t]*)(.*?)(?=registrar:)/is', 49 | 3 => '/registrar:(?>[\x20\t]*)(.*?)(?=WHOIS displays data)/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/^(nameservers:)?(?>[\x20\t]+)(.+)\./im' => 'nameserver', 59 | '/^(nameservers:)?(?>[\x20\t]+)(.+)\. \[.+\]/im' => 'nameserver', 60 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'created', 61 | '/last modified:(?>[\x20\t]*)(.+)$/im' => 'changed', 62 | '/renewal date:(?>[\x20\t]*)(.+)$/im' => 'expires', 63 | '/dnssec:(?>[\x20\t]*)(.+)$/im' => 'dnssec'), 64 | 65 | 2 => array('/company:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 66 | '/^(?>[\x20\t]+)(.+)$/im' => 'contacts:tech:organization', 67 | '/street:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:address', 68 | '/city:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:city', 69 | '/location:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:country', 70 | '/handle:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 71 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone', 72 | '/fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:fax', 73 | '/last modified:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:changed'), 74 | 75 | 3 => array('/registrar:\n(.*)$/im' => 'registrar:name', 76 | '/(?=fax:).+\n(.+)\n\n$/is' => 'registrar:email')); 77 | 78 | /** 79 | * RegEx to check availability of the domain name 80 | * 81 | * @var string 82 | * @access protected 83 | */ 84 | protected $available = '/No information available about domain/i'; 85 | 86 | /** 87 | * After parsing ... 88 | * 89 | * If dnssec key was found we set attribute to true. 90 | * 91 | * @param object &$WhoisParser 92 | * @return void 93 | */ 94 | public function postProcess(&$WhoisParser) 95 | { 96 | $ResultSet = $WhoisParser->getResult(); 97 | 98 | if ($ResultSet->dnssec === 'Unsigned') { 99 | $ResultSet->dnssec = false; 100 | } else { 101 | $ResultSet->dnssec = true; 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /Templates/Qa.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)(?=registrant contact id)/is', 47 | 2 => '/registrant contact id:(?>[\x20\t]*)(.*?)(?=tech contact id)/is', 48 | 3 => '/tech contact id:(?>[\x20\t]*)(.*?)(?=name server)/is', 49 | 4 => '/name server:(?>[\x20\t]*)(.*?)$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/last modified:(?>[\x20\t]*)(.+)$/im' => 'changed', 59 | '/registrar name:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 60 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status'), 61 | 2 => array('/registrant contact id:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 62 | '/registrant contact name:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:name', 63 | '/registrant contact city:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:city', 64 | '/registrant contact country:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:country'), 65 | 3 => array('/tech contact id:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 66 | '/tech contact name:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 67 | '/tech contact city:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:city', 68 | '/tech contact country:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:country'), 69 | 4 => array('/name server:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 70 | '/name server ip:(?>[\x20\t]*)(.+)$/im' => 'ips')); 71 | 72 | /** 73 | * RegEx to check availability of the domain name 74 | * 75 | * @var string 76 | * @access protected 77 | */ 78 | protected $available = '/No Data Found/i'; 79 | } -------------------------------------------------------------------------------- /Templates/Ripe.php: -------------------------------------------------------------------------------- 1 | '/(inetnum|inet6num|as-block):[\s]*(.*?)[\n]{2}/is', 47 | 2 => '/(role|person|organisation):[\s]*(.*?)[\n]{2}/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/^as-block:(?>[\x20\t]*)(.+)$/im' => 'network:as-block', 57 | '/^inetnum:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 58 | '/^inet6num:(?>[\x20\t]*)(.+)$/im' => 'network:inetnum', 59 | '/^netname:(?>[\x20\t]*)(.+)$/im' => 'network:name', 60 | '/^mnt-by:(?>[\x20\t]*)(.+)$/im' => 'network:maintainer', 61 | '/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 62 | '/^org:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:owner', 63 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 64 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech'), 65 | 66 | 2 => array('/^organisation:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 67 | '/^org:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 68 | '/^nic-hdl:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 69 | '/^org-name:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 70 | '/^role:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 71 | '/^person:(?>[\x20\t]*)(.+)$/im' => 'contacts:name', 72 | '/^address:(?>[\x20\t]*)(.+)/im' => 'contacts:address', 73 | '/^abuse-mailbox:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 74 | '/^phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 75 | '/^fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax')); 76 | } -------------------------------------------------------------------------------- /Templates/Ro.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)$/is'); 47 | 48 | /** 49 | * Items for each block 50 | * 51 | * @var array 52 | * @access protected 53 | */ 54 | protected $blockItems = array( 55 | 1 => array('/registered on:(?>[\x20\t]*)(.+)$/im' => 'created', 56 | '/expires on:(?>[\x20\t]*)(.+)$/im' => 'expires', 57 | '/registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 58 | '/nameserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 59 | '/domain status:(?>[\x20\t]*)(.+)$/im' => 'status')); 60 | 61 | /** 62 | * RegEx to check availability of the domain name 63 | * 64 | * @var string 65 | * @access protected 66 | */ 67 | protected $available = '/No entries found for the selected/i'; 68 | } -------------------------------------------------------------------------------- /Templates/Ru.php: -------------------------------------------------------------------------------- 1 | '/^domain$/i', 12 | 'created' => '/^created$/i', 13 | 'expires' => '/^paid-till$/i', 14 | 'nameserver' => '/^nserver$/i', 15 | 'status' => '/^state$/i', 16 | // Registrar 17 | 'registrar:id' => '/^registrar$/i', 18 | // Contacts: Owner 19 | 'contacts:owner:name' => '/^person$/i', 20 | 'contacts:owner:organization' => '/^org$/i', 21 | 'contacts:owner:phone' => '/^phone$/i', 22 | 'contacts:owner:fax' => '/^fax$/i', 23 | 'contacts:owner:email' => '/^e-mail$/i', 24 | ); 25 | 26 | protected $available = '/No entries found/i'; 27 | 28 | 29 | public function reformatData() 30 | { 31 | if (array_key_exists('state', $this->data) && (! is_array($this->data['state']))) { 32 | $this->data['state'] = explode(', ', $this->data['state']); 33 | } 34 | 35 | $dateFields = ['created', 'free-date', 'paid-till']; 36 | foreach ($dateFields as $field) { 37 | if (array_key_exists($field, $this->data)) { 38 | $this->data[$field] = str_replace('.', '-', $this->data[$field]); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Templates/Se.php: -------------------------------------------------------------------------------- 1 | 37 | */ 38 | class Se extends Regex 39 | { 40 | 41 | /** 42 | * Blocks within the raw output of the whois 43 | * 44 | * @var array 45 | * @access protected 46 | */ 47 | protected $blocks = array( 48 | 1 => '/state(.*?)$/is', 49 | ); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array( 59 | '/^nserver:(?>[\s]+)(.+)$/im' => 'nameserver', 60 | '/^created:(?>[\x20\t]*)(.+)$/im' => 'created', 61 | '/^modified:(?>[\x20\t]*)(.+)$/im' => 'changed', 62 | '/^expires:(?>[\x20\t]*)(.+)$/im' => 'expires', 63 | '/^registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 64 | '/^status:(?>[\x20\t]*)(.+)$/im' => 'status', 65 | '/^dnssec:(?>[\x20\t]*)(.+)$/im' => 'dnssec', 66 | 67 | '/^holder:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:handle', 68 | '/^admin-c:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:handle', 69 | '/^tech-c:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 70 | '/^billing-c:(?>[\x20\t]*)(.+)$/im' => 'contacts:billing:handle', 71 | ), 72 | ); 73 | 74 | /** 75 | * RegEx to check availability of the domain name 76 | * 77 | * @var string 78 | * @access protected 79 | */ 80 | protected $available = '/" not found./i'; 81 | 82 | /** 83 | * After parsing ... 84 | * 85 | * If dnssec key was found we set attribute to true. 86 | * 87 | * @param object &$WhoisParser 88 | * @return void 89 | */ 90 | public function postProcess(&$WhoisParser) 91 | { 92 | $ResultSet = $WhoisParser->getResult(); 93 | if (preg_match("/unsigned/i", $ResultSet->dnssec)) { 94 | $ResultSet->dnssec = false; 95 | } else { 96 | $ResultSet->dnssec = true; 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Templates/Sg.php: -------------------------------------------------------------------------------- 1 | '/registrar:(?>[\x20\t]*)(.*?)(?=registrant)/is', 47 | 2 => '/registrant:(?>[\x20\t]*)(.*?)(?=administrative contact)/is', 48 | 3 => '/administrative contact:(?>[\x20\t]*)(.*?)(?=technical contact)/is', 49 | 4 => '/technical contact:(?>[\x20\t]*)(.*?)(?=name servers)/is', 50 | 5 => '/name servers:(?>[\x20\t]*)(.*?)$/is'); 51 | 52 | /** 53 | * Items for each block 54 | * 55 | * @var array 56 | * @access protected 57 | */ 58 | protected $blockItems = array( 59 | 1 => array('/registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 60 | '/creation date:(?>[\x20\t]*)(.+)$/im' => 'created', 61 | '/modified date:(?>[\x20\t]*)(.+)$/im' => 'changed', 62 | '/expiration date:(?>[\x20\t]*)(.+)$/im' => 'expires', 63 | '/domain status:(?>[\x20\t]*)(.+)$/im' => 'status'), 64 | 2 => array('/name:(?>[\x20\t]*)(.+) \(.+\)/im' => 'contacts:owner:name', 65 | '/name:(?>[\x20\t]*).+ \((.+)\)/im' => 'contacts:owner:handle'), 66 | 3 => array('/name:(?>[\x20\t]*)(.+) \(.+\)/im' => 'contacts:admin:name', 67 | '/name:(?>[\x20\t]*).+ \((.+)\)/im' => 'contacts:admin:handle'), 68 | 4 => array('/name:(?>[\x20\t]*)(.+) \(.+\)/im' => 'contacts:tech:name', 69 | '/name:(?>[\x20\t]*).+ \((.+)\)/im' => 'contacts:tech:handle', 70 | '/email:(?>[\x20\t]*)(.+)/im' => 'contacts:tech:email'), 71 | 5 => array('/\n(?>[\x20\t]+)(.+)$/im' => 'nameserver')); 72 | 73 | /** 74 | * RegEx to check availability of the domain name 75 | * 76 | * @var string 77 | * @access protected 78 | */ 79 | protected $available = '/Domain Not Found/i'; 80 | } -------------------------------------------------------------------------------- /Templates/Sk.php: -------------------------------------------------------------------------------- 1 | '/admin-id(.*?)(?=tech-id)/is', 47 | 2 => '/tech-id(.*?)(?=dns_name)/is', 3 => '/dns_name(.*?)$/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/admin-id(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:handle', 57 | '/admin-name(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:name', 58 | '/admin-address(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:address', 59 | '/admin-telephone(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:phone', 60 | '/admin-email(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:email', 61 | '/admin-org.-ID(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:orgid'), 62 | 63 | 2 => array('/tech-id(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 64 | '/tech-name(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 65 | '/tech-address(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:address', 66 | '/tech-telephone(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone', 67 | '/tech-email(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:email', 68 | '/tech-org.-ID(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:orgid'), 69 | 70 | 3 => array('/dns_name(?>[\x20\t]*)(.+)$/im' => 'nameserver', 71 | '/dns_ipv4(?>[\x20\t]*)(.+)$/im' => 'ips', 72 | '/last-update(?>[\x20\t]*)(.+)$/im' => 'changed', 73 | '/valid-date(?>[\x20\t]*)(.+)$/im' => 'expires', 74 | '/domain-status(?>[\x20\t]*)(.+)$/im' => 'status')); 75 | 76 | /** 77 | * RegEx to check availability of the domain name 78 | * 79 | * @var string 80 | * @access protected 81 | */ 82 | protected $available = '/Not found./i'; 83 | } -------------------------------------------------------------------------------- /Templates/Sm.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)(?=owner)/is', 47 | 2 => '/owner:\n(?>[\x20\t]*)(.*?)(?=technical contact)/is', 48 | 3 => '/technical contact:\n(?>[\x20\t]*)(.*?)(?=dns servers)/is', 49 | 4 => '/dns servers:\n(?>[\x20\t]*)(.*?)$/is'); 50 | 51 | /** 52 | * Items for each block 53 | * 54 | * @var array 55 | * @access protected 56 | */ 57 | protected $blockItems = array( 58 | 1 => array('/registration date:(?>[\x20\t]*)(.+)$/im' => 'created', 59 | '/last update:(?>[\x20\t]*)(.+)$/im' => 'changed', 60 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status'), 61 | 2 => array('/owner:\n(?>[\x20\t]*)(.+)(?=phone)/is' => 'contacts:owner:address', 62 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:phone', 63 | '/fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:fax', 64 | '/email:(?>[\x20\t]*)(.+)$/im' => 'contacts:owner:email'), 65 | 3 => array( 66 | '/technical contact:\n(?>[\x20\t]*)(.+)(?=phone)/is' => 'contacts:tech:address', 67 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone', 68 | '/fax:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:fax', 69 | '/email:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:email'), 70 | 4 => array('/\n(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 71 | 72 | /** 73 | * RegEx to check availability of the domain name 74 | * 75 | * @var string 76 | * @access protected 77 | */ 78 | protected $available = '/No entries found./i'; 79 | 80 | /** 81 | * After parsing do something 82 | * 83 | * Fix addresses 84 | * 85 | * @param object &$WhoisParser 86 | * @return void 87 | */ 88 | public function postProcess(&$WhoisParser) 89 | { 90 | $ResultSet = $WhoisParser->getResult(); 91 | 92 | foreach ($ResultSet->contacts as $contactType => $contactArray) { 93 | foreach ($contactArray as $contactObject) { 94 | $filteredAddress = array_map('trim', explode("\n", trim($contactObject->address))); 95 | 96 | $contactObject->name = $filteredAddress[0]; 97 | $contactObject->organization = $filteredAddress[1]; 98 | $contactObject->address = $filteredAddress[2]; 99 | $contactObject->city = $filteredAddress[3]; 100 | $contactObject->country = $filteredAddress[4]; 101 | } 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /Templates/St.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)(?=administrative contact)/is', 47 | 2 => '/administrative contact:(?>[\x20\t]*)(.*?)(?=name servers)/is', 48 | 3 => '/name servers:(?>[\x20\t]*)(.*?)$/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/registrar:(?>[\x20\t]*)(.*?)$/im' => 'registrar:name', 58 | '/creation Date:(?>[\x20\t]*)(.*?)$/im' => 'created', 59 | '/updated Date:(?>[\x20\t]*)(.*?)$/im' => 'changed', 60 | '/contact:(?>[\x20\t]*)(.*?)$/im' => 'registrar:email'), 61 | 2 => array('/owner:(?>[\x20\t]*)(.*?)$/im' => 'contacts:admin:organization', 62 | '/^(?>[\x20\t]*)contact:(?>[\x20\t]*)(.*?)$/im' => 'contacts:admin:name', 63 | '/address:(?>[\x20\t]*)(.*?)$/im' => 'contacts:admin:address', 64 | '/city:(?>[\x20\t]*)(.*?)$/im' => 'contacts:admin:city', 65 | '/country:(?>[\x20\t]*)(.*?)$/im' => 'contacts:admin:country'), 66 | 3 => array('/\n(?>[\x20\t]*)(.+)$/im' => 'nameserver')); 67 | 68 | /** 69 | * RegEx to check availability of the domain name 70 | * 71 | * @var string 72 | * @access protected 73 | */ 74 | protected $available = '/No entries found/i'; 75 | } -------------------------------------------------------------------------------- /Templates/Standardliar.php: -------------------------------------------------------------------------------- 1 | available) && strlen($this->available)) { 17 | preg_match_all($this->available, $rawdata, $matches); 18 | 19 | $registered = empty($matches[0]); 20 | if (! $registered) { 21 | if (isset($result->registered) && $result->registered) { 22 | return; 23 | } 24 | } 25 | } 26 | 27 | parent::parse($result, $rawdata); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Templates/Su.php: -------------------------------------------------------------------------------- 1 | '/^domain$/i', 12 | 'created' => '/^created$/i', 13 | 'expires' => '/^paid-till$/i', 14 | 'nameserver' => '/^nserver$/i', 15 | 'status' => '/^state$/i', 16 | // Registrar 17 | 'registrar:id' => '/^registrar$/i', 18 | // Contacts: Owner 19 | 'contacts:owner:name' => '/^person$/i', 20 | 'contacts:owner:organization' => '/^org$/i', 21 | 'contacts:owner:phone' => '/^phone$/i', 22 | 'contacts:owner:fax' => '/^fax$/i', 23 | 'contacts:owner:email' => '/^e-mail$/i', 24 | ); 25 | 26 | protected $available = '/No entries found/i'; 27 | 28 | 29 | public function reformatData() 30 | { 31 | if (array_key_exists('state', $this->data) && (! is_array($this->data['state']))) { 32 | $this->data['state'] = explode(', ', $this->data['state']); 33 | } 34 | 35 | $dateFields = ['created', 'free-date', 'paid-till']; 36 | foreach ($dateFields as $field) { 37 | if (array_key_exists($field, $this->data)) { 38 | $this->data[$field] = str_replace('.', '-', $this->data[$field]); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Templates/Support.php: -------------------------------------------------------------------------------- 1 | '/Domain Name:(.*?)(?=Registrant ID)/is' 48 | ); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/Registry Expiry Date:(?>[\x20\t]*)(.+)$/im' => 'expires') 58 | ); 59 | } -------------------------------------------------------------------------------- /Templates/Tk.php: -------------------------------------------------------------------------------- 1 | '/organisation:\n(.*?)(?=domain nameservers)/is', 47 | 2 => '/domain registered:(?>[\x20\t]*)(.*?)$/is', 48 | 3 => '/domain nameservers:\n(?>[\x20\t]*)(.*?)(?=domain registered)/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array(1 => array('/organisation:(.*?)$/is' => 'contacts:owner:address'), 57 | 2 => array('/domain registered:(?>[\x20\t]*)(.+)$/im' => 'created', 58 | '/record will expire on:(?>[\x20\t]*)(.+)$/im' => 'expires'), 59 | 3 => array('/\n(?>[\x20\t]+)(.+)$/im' => 'nameserver', 60 | '/\n(?>[\x20\t]+)(.+) \(.+\)$/im' => 'nameserver', 61 | '/\n(?>[\x20\t]+).+ \((.+)\)$/im' => 'ips')); 62 | 63 | /** 64 | * RegEx to check availability of the domain name 65 | * 66 | * @var string 67 | * @access protected 68 | */ 69 | protected $available = '/Invalid query or domain name not known in/i'; 70 | 71 | /** 72 | * After parsing do something 73 | * 74 | * Fix contact address 75 | * 76 | * @param object &$WhoisParser 77 | * @return void 78 | */ 79 | public function postProcess(&$WhoisParser) 80 | { 81 | $ResultSet = $WhoisParser->getResult(); 82 | 83 | if (isset($ResultSet->contacts->owner[0]->address)) { 84 | $filteredAddress = array_map('trim', explode("\n", trim($ResultSet->contacts->owner[0]->address))); 85 | $filteredAddress = array_pad($filteredAddress, 9, ''); 86 | $ResultSet->contacts->owner[0]->organization = $filteredAddress[0]; 87 | $ResultSet->contacts->owner[0]->name = $filteredAddress[1]; 88 | $ResultSet->contacts->owner[0]->city = $filteredAddress[3]; 89 | $ResultSet->contacts->owner[0]->state = $filteredAddress[4]; 90 | $ResultSet->contacts->owner[0]->country = $filteredAddress[5]; 91 | $ResultSet->contacts->owner[0]->phone = str_replace('Phone: ', '', $filteredAddress[6]); 92 | $ResultSet->contacts->owner[0]->fax = str_replace('Fax: ', '', $filteredAddress[7]); 93 | $ResultSet->contacts->owner[0]->email = str_replace('E-mail: ', '', $filteredAddress[8]); 94 | $ResultSet->contacts->owner[0]->address = $filteredAddress[2]; 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Templates/Tv.php: -------------------------------------------------------------------------------- 1 | '/domain name:(?>[\x20\t]*)(.*?)(?=>>>)/is'); 47 | 48 | /** 49 | * Items for each block 50 | * 51 | * @var array 52 | * @access protected 53 | */ 54 | protected $blockItems = array( 55 | 1 => array('/whois server:(?>[\x20\t]*)(.+)$/im' => 'whoisserver', 56 | '/registrar:(?>[\x20\t]*)(.+)$/im' => 'registrar:name', 57 | '/registrar iana id:(?>[\x20\t]*)(.+)$/im' => 'registrar:id', 58 | '/referral url:(?>[\x20\t]*)(.+)$/im' => 'registrar:url', 59 | '/creation date:(?>[\x20\t]*)(.+)$/im' => 'created', 60 | '/Registry Expiry Date:(?>[\x20\t]*)(.+)$/im' => 'expires', 61 | '/updated date:(?>[\x20\t]*)(.+)$/im' => 'changed', 62 | '/name server:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 63 | '/dnssec:(?>[\x20\t]*)(.+)$/im' => 'dnssec', 64 | '/status:(?>[\x20\t]*)(.+)$/im' => 'status')); 65 | 66 | /** 67 | * RegEx to check availability of the domain name 68 | * 69 | * @var string 70 | * @access protected 71 | */ 72 | protected $available = '/No match for/i'; 73 | 74 | /** 75 | * After parsing ... 76 | * 77 | * Verisign is a thin registry, therefore they only provide us some details and the 78 | * real whois server of the registrar for the given domain name. Therefore we have 79 | * to restart the process with the real whois server. 80 | * 81 | * @param object &$WhoisParser 82 | * @return void 83 | */ 84 | public function postProcess(&$WhoisParser) 85 | { 86 | $ResultSet = $WhoisParser->getResult(); 87 | $Config = $WhoisParser->getConfig(); 88 | 89 | if ((isset($ResultSet->dnssec) || $ResultSet->dnssec === null) && 90 | ($ResultSet->dnssec === 'Unsigned delegation' || $ResultSet->dnssec == '')) { 91 | $ResultSet->dnssec = false; 92 | } else { 93 | $ResultSet->dnssec = true; 94 | } 95 | 96 | // check if registrar name is set, if not then there was an error while 97 | // parsing 98 | if (! isset($ResultSet->registrar->name)) { 99 | return; 100 | } 101 | 102 | $newConfig = $Config->get($ResultSet->whoisserver); 103 | 104 | if ($newConfig['server'] == '') { 105 | $newConfig['server'] = $ResultSet->whoisserver; 106 | } 107 | 108 | $Config->setCurrent($newConfig); 109 | $WhoisParser->call(); 110 | } 111 | } -------------------------------------------------------------------------------- /Templates/Type/KeyValue.php: -------------------------------------------------------------------------------- 1 | parseRateLimit($rawdata); 30 | 31 | // check availability upon type - IP addresses are always registered 32 | $parsedAvailable = false; 33 | if (isset($this->available) && strlen($this->available)) { 34 | preg_match_all($this->available, $rawdata, $matches); 35 | $parsedAvailable = count($matches); 36 | 37 | $result->addItem('registered', empty($matches[0])); 38 | } 39 | 40 | $this->data = $this->parseRawData($rawdata); 41 | $this->reformatData(); 42 | $matches = $this->parseKeyValues($result, $this->data, $this->regexKeys, false); 43 | 44 | if (($matches < 1) && (!$parsedAvailable)) { 45 | throw new ReadErrorException("Template did not correctly parse the response"); 46 | } 47 | } 48 | 49 | 50 | protected function parseRawData($rawdata) 51 | { 52 | $data = array(); 53 | $rawdata = explode("\n", $rawdata); 54 | foreach ($rawdata as $line) { 55 | $line = trim($line); 56 | $lineParts = explode(':', $line, 2); 57 | if (count($lineParts) < 2) { 58 | continue; 59 | } 60 | 61 | $key = trim($lineParts[0]); 62 | $value = trim($lineParts[1]); 63 | 64 | if (array_key_exists($key, $data)) { 65 | if (! is_array($data[$key])) { 66 | $data[$key] = array($data[$key]); 67 | } 68 | $data[$key][] = $value; 69 | continue; 70 | } 71 | 72 | $data[$key] = $value; 73 | } 74 | 75 | return $data; 76 | } 77 | 78 | 79 | protected function parseKeyValues($result, $dataArray, $regexKeys, $append = false) 80 | { 81 | $matches = 0; 82 | foreach ($dataArray as $key => $value) { 83 | foreach ($regexKeys as $dataKey => $regexList) { 84 | if (! is_array($regexList)) { 85 | $regexList = array($regexList); 86 | } 87 | 88 | foreach ($regexList as $regex) { 89 | if (preg_match($regex, $key)) { 90 | $matches++; 91 | $result->addItem($dataKey, $value, $append); 92 | break 2; 93 | } 94 | } 95 | } 96 | } 97 | 98 | return $matches; 99 | } 100 | 101 | 102 | /** 103 | * Perform any necessary reformatting of data (for example, reformatting dates) 104 | */ 105 | protected function reformatData() 106 | { 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Templates/Type/Regex.php: -------------------------------------------------------------------------------- 1 | parseRateLimit($rawdata); 16 | 17 | // check if there is a block to be cutted from HTML response 18 | if (isset($this->htmlBlock)) { 19 | preg_match($this->htmlBlock, $rawdata, $htmlMatches); 20 | 21 | if (isset($htmlMatches[0])) { 22 | $rawdata = preg_replace('/\s\s+/', "\n", $htmlMatches[0]); 23 | } 24 | } 25 | 26 | // lookup all blocks of template 27 | foreach ($this->blocks as $blockKey => $blockRegEx) { 28 | // try to match block regex against WHOIS rawdata 29 | if (!preg_match_all($blockRegEx, $rawdata, $blockMatches)) { 30 | continue; 31 | } 32 | 33 | // use matched block to lookup for blockItems 34 | foreach ($blockMatches[0] as $item) { 35 | foreach ($this->blockItems[$blockKey] as $itemRegEx => $target) { 36 | // try to match blockItem regex against block 37 | if (preg_match_all($itemRegEx, $item, $itemMatches)) { 38 | // set matched items to Result 39 | $value = end($itemMatches); 40 | if ($this->convertFromHtml) { 41 | if (is_array($value)) { 42 | foreach($value as $k => $v) { 43 | $value[$k] = html_entity_decode(strip_tags($v)); 44 | } 45 | } else { 46 | $value = html_entity_decode(strip_tags($value)); 47 | } 48 | } 49 | $result->addItem($target, $value); 50 | } 51 | } 52 | } 53 | } 54 | 55 | // if there are still contact handles after parsing then 56 | // these contacts are used for more types e.g. one handle for admin and 57 | // tech so we are going to clone this matching handles 58 | if (isset($result->network->contacts)) { 59 | // lookup all left over handles in network 60 | foreach ($result->network->contacts as $type => $handle) { 61 | if (! is_string($handle)) { 62 | continue; 63 | } 64 | 65 | // lookup all contacts in Result 66 | foreach ($result->contacts as $contactType => $contactArray) { 67 | foreach ($contactArray as $contactObject) { 68 | // if contact handle in network matches the one in 69 | // Result, we have to clone it 70 | if (strtolower($contactObject->handle) !== strtolower($handle)) { 71 | continue; 72 | } 73 | 74 | if (empty($result->contacts->$type)) { 75 | $result->contacts->$type = Array(); 76 | } 77 | array_push($result->contacts->$type, $contactObject); 78 | unset($result->network->contacts->$type); 79 | break 2; 80 | } 81 | } 82 | } 83 | } 84 | 85 | // check availability upon type - IP addresses are always registered 86 | if (isset($this->available) && strlen($this->available)) { 87 | preg_match_all($this->available, $rawdata, $matches); 88 | 89 | $value = $matches[0]; 90 | if ($this->convertFromHtml && (!is_array($value))) { 91 | $value = html_entity_decode(strip_tags($value)); 92 | } 93 | $result->addItem('registered', empty($value)); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Templates/Ua.php: -------------------------------------------------------------------------------- 1 | '/domain:(?>[\x20\t]*)(.*?)(?=\% administrative contact)/is', 47 | 2 => '/\% (administrative|technical) contact:(.*?)(?=(\% technical contact:|\% \% .ua whois))/is'); 48 | 49 | /** 50 | * Items for each block 51 | * 52 | * @var array 53 | * @access protected 54 | */ 55 | protected $blockItems = array( 56 | 1 => array('/status:(?>[\x20\t]*).+ (.+)$/im' => 'expires', 57 | '/nserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 58 | '/admin-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:admin', 59 | '/tech-c:(?>[\x20\t]*)(.+)$/im' => 'network:contacts:tech', 60 | '/created:(?>[\x20\t]*).+ (.+)$/im' => 'created', 61 | '/changed:(?>[\x20\t]*).+ (.+)$/im' => 'changed'), 62 | 2 => array('/nic-handle:(?>[\x20\t]*)(.+)$/im' => 'contacts:handle', 63 | '/organization:(?>[\x20\t]*)(.+)$/im' => 'contacts:organization', 64 | '/address:(?>[\x20\t]*)(.+)$/im' => 'contacts:address', 65 | '/phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:phone', 66 | '/fax-no:(?>[\x20\t]*)(.+)$/im' => 'contacts:fax', 67 | '/e-mail:(?>[\x20\t]*)(.+)$/im' => 'contacts:email', 68 | '/changed:(?>[\x20\t]*).+ (.+)$/im' => 'contacts:changed')); 69 | 70 | /** 71 | * RegEx to check availability of the domain name 72 | * 73 | * @var string 74 | * @access protected 75 | */ 76 | protected $available = '/No entries found for/i'; 77 | 78 | public function postProcess(&$WhoisParser) 79 | { 80 | $ResultSet = $WhoisParser->getResult(); 81 | $date = \DateTime::createFromFormat('YmdHis', $ResultSet->expires); 82 | 83 | $ResultSet->expires = ''; 84 | if ($date instanceof \DateTime) { 85 | $ResultSet->expires = $date->format('Y-m-d H:i:s'); 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /Templates/Ug.php: -------------------------------------------------------------------------------- 1 | '/Domain:(?>[\x20\t]*)(.*?)\n\n/is', 47 | 2 => '/\n\nAdmin Contact:(?>[\x20\t]*)(.*?)(?=Tech Contact:)/is', 48 | 3 => '/\n\nTech Contact:(?>[\x20\t]*)(.*?)$/is'); 49 | 50 | /** 51 | * Items for each block 52 | * 53 | * @var array 54 | * @access protected 55 | */ 56 | protected $blockItems = array( 57 | 1 => array('/Registered:(?>[\x20\t]*)(.+)$/im' => 'created', 58 | '/Expiry:(?>[\x20\t]*)(.+)$/im' => 'expires', 59 | '/Status:(?>[\x20\t]*)(.+)$/im' => 'status', 60 | '/Nameserver:(?>[\x20\t]*)(.+)$/im' => 'nameserver', 61 | '/Updated:(?>[\x20\t]*)(.+)$/im' => 'changed'), 62 | 2 => array('/Admin Contact:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:name', 63 | '/NIC:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:handle', 64 | '/Address:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:address', 65 | '/City:(?>[\x20\t]*)(.+)(?=Created)/is' => 'contacts:admin:city', 66 | '/Country:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:country', 67 | '/Phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:admin:phone'), 68 | 3 => array('/Tech Contact:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:name', 69 | '/NIC:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:handle', 70 | '/Address:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:address', 71 | '/City:(?>[\x20\t]*)(.+)(?=Created)/is' => 'contacts:tech:city', 72 | '/Country:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:country', 73 | '/Phone:(?>[\x20\t]*)(.+)$/im' => 'contacts:tech:phone')); 74 | 75 | /** 76 | * RegEx to check availability of the domain name 77 | * 78 | * @var string 79 | * @access protected 80 | */ 81 | protected $available = '/No entries found for/i'; 82 | } -------------------------------------------------------------------------------- /Templates/Uk.php: -------------------------------------------------------------------------------- 1 | '/registrant:(.*?)(?=registrant type:)/is', 47 | 2 => '/address:(.*?)(?=registrar:)/is', 3 => '/registrar:(.*?)(?=relevant dates:)/is', 48 | 4 => '/relevant dates:(.*?)(?=registration status:)/is', 49 | 5 => '/registration status:(.*?)(?=name servers:)/is', 50 | 6 => '/name servers:(.*?)(?=whois lookup made)/is'); 51 | 52 | /** 53 | * Items for each block 54 | * 55 | * @var array 56 | * @access protected 57 | */ 58 | protected $blockItems = array( 59 | 1 => array('/registrant:(?>[\n\x20\t]*)(.+)/im' => 'contacts:owner:name'), 60 | 2 => array('/address:(?>[\n\x20\t]*)(.+)$/is' => 'contacts:owner:address'), 61 | 3 => array('/registrar:(?>[\n\x20\t]*)(.+) \[.+\]$/im' => 'registrar:name', 62 | '/url:(?>[\n\x20\t]*)(.+)$/im' => 'registrar:url', 63 | '/\[tag = (.+)\]$/im' => 'registrar:id'), 64 | 4 => array('/registered on:(?>[\x20\t]*)(.+)$/im' => 'created', 65 | '/expiry date:(?>[\x20\t]*)(.*)$/im' => 'expires', 66 | '/last updated:(?>[\x20\t]*)(.+)$/im' => 'changed'), 67 | 5 => array('/registration status:(?>[\n\x20\t]*)(.+)/im' => 'status'), 68 | 6 => array('/\n(?>[\x20\t]+)(.+)$/im' => 'nameserver')); 69 | 70 | /** 71 | * RegEx to check availability of the domain name 72 | * 73 | * @var string 74 | * @access protected 75 | */ 76 | protected $available = '/This domain name has not been registered/i'; 77 | 78 | /** 79 | * After parsing do something 80 | * 81 | * Fix owner address 82 | * 83 | * @param object &$WhoisParser 84 | * @return void 85 | */ 86 | public function postProcess(&$WhoisParser) 87 | { 88 | $ResultSet = $WhoisParser->getResult(); 89 | 90 | foreach ($ResultSet->contacts as $contactType => $contactArray) { 91 | foreach ($contactArray as $contactObject) { 92 | $filteredAddress = array_map('trim', explode("\n", trim($contactObject->address))); 93 | 94 | $contactObject->address = $filteredAddress[0]; 95 | $contactObject->city = $filteredAddress[1]; 96 | $contactObject->state = $filteredAddress[2]; 97 | $contactObject->zipcode = $filteredAddress[3]; 98 | $contactObject->country = $filteredAddress[4]; 99 | } 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /Templates/Venez.php: -------------------------------------------------------------------------------- 1 | WHOIS (.*?)
/i'; 12 | 13 | protected $blocks = array( 14 | 1 => '/Statut domaine: (.*?)<\/b>/im', 15 | 2 => '/Date de création: (.*?)<\/b>/im', 16 | 3 => '/Dernière modification: (.*?)<\/b>/im', 17 | 4 => '/Type: (.*?)<\/b>/im', 18 | 5 => '/Personne: (.*?)<\/b>/im', 19 | 6 => '/Raison sociale: (.*?)<\/b>/im', 20 | 7 => '/Adresse électronique: (.*)<\/a>/im', 21 | ); 22 | 23 | protected $blockItems = array( 24 | 1 => array( 25 | '/(.*?)<\/b>/i' => 'status', 26 | ), 27 | 2 => array( 28 | '/(.*?)<\/b>/i' => 'created', 29 | ), 30 | 3 => array( 31 | '/(.*?)<\/b>/i' => 'changed', 32 | ), 33 | 4 => array( 34 | ), 35 | 5 => array( 36 | '/(.*?)<\/b>/i' => 'contacts:owner:name', 37 | ), 38 | 6 => array( 39 | '/(.*?)<\/b>/i' => 'contacts:owner:organization', 40 | ), 41 | 7 => array( 42 | '//i' => 'contacts:owner:email', 43 | ), 44 | ); 45 | 46 | protected $available = '/Domaine non trouvé/i'; 47 | 48 | 49 | public function postProcess(&$whoisParser) 50 | { 51 | $result = $whoisParser->getResult(); 52 | 53 | foreach ($result->contacts as $contactType => $contactArray) { 54 | foreach ($contactArray as $contactObject) { 55 | $contactObject->email = html_entity_decode($contactObject->email); 56 | } 57 | } 58 | 59 | $dateFields = array('created', 'changed', 'expires'); 60 | $originalDateFormat = 'd/m/Y à H:i:s'; 61 | foreach ($dateFields as $field) { 62 | if (isset($result->$field) && strlen($result->$field)) { 63 | $dt = \DateTime::createFromFormat($originalDateFormat, $result->$field); 64 | if (is_object($dt)) { 65 | $result->$field = $dt->format('Y-m-d H:i:s'); 66 | } 67 | } 68 | } 69 | } 70 | 71 | 72 | public function translateRawData($rawdata) 73 | { 74 | return utf8_encode($rawdata); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Templates/Vu.php: -------------------------------------------------------------------------------- 1 | '/^Date Created$/i', 12 | 'expires' => '/^Expiry Date$/i', 13 | 'nameserver' => '/^DNS servers[0-9]*$/i', 14 | // Contacts: Owner 15 | 'contacts:owner:name' => '/^Full Name$/i', 16 | 'contacts:owner:address' => '/^Adress$/i', 17 | 'contacts:owner:city' => '/^City$/i', 18 | 'contacts:owner:country' => '/^Country$/i', 19 | ); 20 | 21 | protected $available = '/is not valid!/i'; 22 | 23 | 24 | public function reformatData() 25 | { 26 | $name = ''; 27 | if (array_key_exists('First Name', $this->data)) { 28 | $name = $this->data['First Name']; 29 | } 30 | if (array_key_exists('Last Name', $this->data)) { 31 | $name .= ' ' . $this->data['Last Name']; 32 | } 33 | $this->data['Full Name'] = trim($name); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "novutec/whoisparser" 3 | , "type": "library" 4 | , "description": "Lookup domain names, IP addresses and AS numbers by WHOIS." 5 | , "keywords": ["whoisparser", "whois", "php"] 6 | , "homepage": "https://github.com/3name/WhoisParser/" 7 | , "author": "Novutec Inc." 8 | , "license": "Apache-2.0" 9 | , "require": { 10 | "novutec/domainparser": ">=2.0.3" 11 | } 12 | , "autoload": { 13 | "psr-4": { 14 | "Novutec\\WhoisParser\\": "" 15 | } 16 | } 17 | } 18 | --------------------------------------------------------------------------------