Rev 11 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 11 | Rev 77 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | 12 | ||
13 | error_reporting(E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED); |
13 | error_reporting(E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED); |
14 | 14 | ||
15 | require_once __DIR__ . '/config.inc.php'; |
15 | require_once __DIR__ . '/config.inc.php'; |
16 | require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php'; |
16 | require_once __DIR__ . '/../../shared/php_includes/common_functions.inc.php'; |
- | 17 | ||
- | 18 | /** @var array $rirs */ |
|
- | 19 | /** @var array $supports_extended_rirstat */ |
|
- | 20 | /** @var array $rir_whois_server */ |
|
- | 21 | /** @var array $rir_domain */ |
|
- | 22 | /** @var array $rirstat_urls */ |
|
- | 23 | /** @var array $ipv4_additional_params */ |
|
- | 24 | /** @var array $ipv6_additional_params */ |
|
- | 25 | /** @var array $asn_additional_params */ |
|
- | 26 | /** @var array $tld_additional_params */ |
|
17 | require_once __DIR__ . '/rirs.inc.php'; |
27 | require_once __DIR__ . '/rirs.inc.php'; |
18 | 28 | ||
19 | $out = ''; |
29 | $out = ''; |
20 | $out .= "# TLDs\n"; |
30 | $out .= "# TLDs\n"; |
21 | $out .= "# Automatically generated by ".__DIR__."/vgwhois-pattern-update\n"; |
31 | $out .= "# Automatically generated by ".__DIR__."/vgwhois-pattern-update\n"; |
Line 38... | Line 48... | ||
38 | if (preg_match('@# Latest update detected on (.*)@', $iana_tld_data[0], $m)) { |
48 | if (preg_match('@# Latest update detected on (.*)@', $iana_tld_data[0], $m)) { |
39 | $version = $m[1]; |
49 | $version = $m[1]; |
40 | $version = substr($version, 0, 10); |
50 | $version = substr($version, 0, 10); |
41 | $version = str_replace('-', '', $version); |
51 | $version = str_replace('-', '', $version); |
42 | if ($version > $max_version) $max_version = $version; |
52 | if ($version > $max_version) $max_version = $version; |
- | 53 | } else { |
|
- | 54 | throw new Exception("Cannot find version of IANA TLD Data"); |
|
43 | } |
55 | } |
44 | 56 | ||
45 | array_shift($iana_tld_data); |
57 | array_shift($iana_tld_data); |
46 | 58 | ||
47 | $tlds = implode('|', $iana_tld_data); |
59 | $tlds = implode('|', $iana_tld_data); |
Line 70... | Line 82... | ||
70 | 82 | ||
71 | if (preg_match('@# Version (\d+), Last Updated (.*)@', $iana_tld_data[0], $m)) { |
83 | if (preg_match('@# Version (\d+), Last Updated (.*)@', $iana_tld_data[0], $m)) { |
72 | $version = $m[1]; |
84 | $version = $m[1]; |
73 | $version = substr($version, 0, 8); |
85 | $version = substr($version, 0, 8); |
74 | if ($version > $max_version) $max_version = $version; |
86 | if ($version > $max_version) $max_version = $version; |
- | 87 | } else { |
|
- | 88 | throw new Exception("Cannot find version of IANA TLD Data"); |
|
75 | } |
89 | } |
76 | 90 | ||
77 | array_shift($iana_tld_data); |
91 | array_shift($iana_tld_data); |
78 | 92 | ||
79 | $tlds = implode('|', $iana_tld_data); |
93 | $tlds = implode('|', $iana_tld_data); |