本文整理汇总了PHP中generic_parser_a函数的典型用法代码示例。如果您正苦于以下问题:PHP generic_parser_a函数的具体用法?PHP generic_parser_a怎么用?PHP generic_parser_a使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generic_parser_a函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
function parse($data_str, $query)
{
$translate = array('fax-no' => 'fax', 'e-mail' => 'email', 'nic-hdl' => 'handle', 'person' => 'name', 'address' => 'address.', 'domain-name' => '', 'updated' => 'changed', 'registration-date' => 'created', 'domain-status' => 'status', 'nameserver' => 'nserver');
$contacts = array('admin-contact' => 'admin', 'technical-contact' => 'tech', 'zone-contact' => 'zone', 'billing-contact' => 'billing');
$extra = array('postal code:' => 'address.pcode');
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'Ymd');
if (isset($reg['domain']['description'])) {
$reg['owner'] = get_contact($reg['domain']['description'], $extra);
unset($reg['domain']['description']);
foreach ($reg as $key => $item) {
if (isset($item['address'])) {
$data = $item['address'];
unset($reg[$key]['address']);
$reg[$key] = array_merge($reg[$key], get_contact($data, $extra));
}
}
$reg['registered'] = 'yes';
} else {
$reg['registered'] = 'no';
}
$r = array();
$r['regrinfo'] = $reg;
$r['regyinfo'] = array('referrer' => 'http://www.nic.ro', 'registrar' => 'nic.ro');
return $r;
}
示例2: parse
function parse($data_str, $query)
{
$translate = array('fax-no' => 'fax', 'e-mail' => 'email', 'nic-hdl' => 'handle', 'person' => 'name', 'netname' => 'name', 'descr' => 'desc');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech');
$r = generic_parser_a($data_str, $translate, $contacts, 'network');
if (isset($r['network']['desc'])) {
$r['owner']['organization'] = $r['network']['desc'];
unset($r['network']['desc']);
}
if (isset($r['admin']['abuse-mailbox'])) {
$r['abuse']['email'] = $r['admin']['abuse-mailbox'];
unset($r['admin']['abuse-mailbox']);
}
if (isset($r['tech']['abuse-mailbox'])) {
$r['abuse']['email'] = $r['tech']['abuse-mailbox'];
unset($r['tech']['abuse-mailbox']);
}
// Clean mess
if (isset($r['tech']['tech-c'])) {
unset($r['tech']['tech-c']);
}
if (isset($r['tech']['admin-c'])) {
unset($r['tech']['admin-c']);
}
if (isset($r['admin']['tech-c'])) {
unset($r['admin']['tech-c']);
}
if (isset($r['admin']['admin-c'])) {
unset($r['admin']['admin-c']);
}
return $r;
}
示例3: parse
function parse($data_str, $query)
{
$translate = array('fax-no' => 'fax', 'e-mail' => 'email', 'nic-hdl-br' => 'handle', 'person' => 'name', 'netname' => 'name', 'domain' => 'name', 'updated' => '');
$contacts = array('owner-c' => 'owner', 'tech-c' => 'tech', 'admin-c' => 'admin', 'billing-c' => 'billing');
$r = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'Ymd');
if (in_array('Permission denied.', $r['disclaimer'])) {
$r['registered'] = 'unknown';
return $r;
}
if (isset($r['domain']['nsstat'])) {
unset($r['domain']['nsstat']);
}
if (isset($r['domain']['nslastaa'])) {
unset($r['domain']['nslastaa']);
}
if (isset($r['domain']['owner'])) {
$r['owner']['organization'] = $r['domain']['owner'];
unset($r['domain']['owner']);
}
if (isset($r['domain']['responsible'])) {
unset($r['domain']['responsible']);
}
if (isset($r['domain']['address'])) {
unset($r['domain']['address']);
}
if (isset($r['domain']['phone'])) {
unset($r['domain']['phone']);
}
$a['regrinfo'] = $r;
$a['regyinfo'] = array('registrar' => 'BR-NIC', 'referrer' => 'http://www.nic.br');
return $a;
}
示例4: parse
function parse($data_str, $query)
{
$translate = array('fax-no' => 'fax', 'e-mail' => 'email', 'nic-hdl-br' => 'handle', 'nic-hdl' => 'handle', 'person' => 'name', 'netname' => 'name', 'descr' => 'desc', 'country' => 'address.country');
$contacts = array('owner-c' => 'owner', 'tech-c' => 'tech', 'abuse-c' => 'abuse', 'admin-c' => 'admin');
$r = generic_parser_a($data_str, $translate, $contacts, 'network');
unset($r['network']['owner']);
unset($r['network']['ownerid']);
unset($r['network']['responsible']);
unset($r['network']['address']);
unset($r['network']['phone']);
unset($r['network']['aut-num']);
unset($r['network']['nsstat']);
unset($r['network']['nslastaa']);
unset($r['network']['inetrev']);
if (!empty($r['network']['aut-num'])) {
$r['network']['handle'] = $r['network']['aut-num'];
}
if (is_array($r['network']['nserver'])) {
$r['network']['nserver'] = array_unique($r['network']['nserver']);
}
$r = array('regrinfo' => $r);
$r['regyinfo']['type'] = 'ip';
$r['regyinfo']['registrar'] = 'Latin American and Caribbean IP address Regional Registry';
return $r;
}
示例5: parse
function parse($data_str, $query)
{
$translate = array('fax-no' => 'fax', 'e-mail' => 'email', 'hun-id' => 'handle', 'person' => 'name', 'nameserver' => 'nserver', 'person' => 'name', 'org' => 'organization', 'registered' => 'created');
$contacts = array('registrar' => 'owner', 'admin-c' => 'admin', 'tech-c' => 'tech', 'billing-c' => 'billing', 'zone-c' => 'zone', 'owner-hun-id' => 'owner');
// make those broken hungary comments standards-conforming
// replace first found hun-id with owner-hun-id (will be parsed later on)
// make output UTF-8
$comments = true;
$owner_id = true;
foreach ($data_str['rawdata'] as $i => $val) {
if ($comments) {
if (strpos($data_str['rawdata'][$i], 'domain:') === false) {
if ($i) {
$data_str['rawdata'][$i] = '% ' . $data_str['rawdata'][$i];
}
} else {
$comments = false;
}
} else {
if ($owner_id && substr($data_str['rawdata'][$i], 0, 7) == 'hun-id:') {
$data_str['rawdata'][$i] = 'owner-' . $data_str['rawdata'][$i];
$owner_id = false;
}
}
}
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts);
unset($reg['domain']['organization']);
unset($reg['domain']['address']);
unset($reg['domain']['phone']);
unset($reg['domain']['fax']);
$r['regrinfo'] = $reg;
$r['regyinfo'] = array('referrer' => 'http://www.nic.hu', 'registrar' => 'HUNIC');
return format_dates($r, 'ymd');
}
示例6: parse
function parse($data_str, $query)
{
$translate = array('fax-no' => 'fax', 'e-mail' => 'email', 'hun-id' => 'handle', 'person' => 'name', 'domain_pri_ns' => 'nserver', 'domain_sec_ns' => 'nserver', 'person' => 'name', 'org' => 'organization', 'registered' => 'created');
$contacts = array('registrar' => 'owner', 'admin-c' => 'admin', 'tech-c' => 'tech', 'billing-c' => 'billing', 'zone-c' => 'zone');
// make those broken hungary comments standards-conforming
for ($i = 1; $i < count($data_str['rawdata']); $i++) {
if (substr($data_str['rawdata'][$i + 1], 0, 7) != 'domain:') {
$data_str['rawdata'][$i] = '% ' . $data_str['rawdata'][$i];
} else {
break;
}
}
// replace first found hun-id with owner-hun-id (will be parsed later on)
for ($i = 1; $i < count($data_str['rawdata']); $i++) {
if (substr($data_str['rawdata'][$i], 0, 7) == 'hun-id:') {
$data_str['rawdata'][$i] = 'owner-' . $data_str['rawdata'][$i];
break;
}
}
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts);
if ($reg['domain']) {
while (list($key, $val) = each($reg['domain'])) {
if (is_array($val)) {
continue;
}
$v = trim(substr(strstr($val, ':'), 1));
if ($key == 'organization') {
$reg['owner']['organization'] = $val;
unset($reg['domain'][$key]);
continue;
}
if ($key == 'owner-hun-id') {
$reg['owner']['handle'] = $val;
unset($reg['domain'][$key]);
continue;
}
if ($key == 'address') {
$reg['owner']['address'] = $val;
unset($reg['domain'][$key]);
continue;
}
if ($key == 'phone') {
$reg['owner']['phone'] = $val;
unset($reg['domain'][$key]);
continue;
}
if ($key == 'fax') {
$reg['owner']['fax'] = $val;
unset($reg['domain'][$key]);
continue;
}
}
}
$r['regrinfo'] = $reg;
$r['regyinfo'] = array('referrer' => 'http://www.nic.hu', 'registrar' => 'HUNIC');
$r['rawdata'] = $data_str['rawdata'];
format_dates($r, 'ymd');
return $r;
}
示例7: parse
function parse($data_str, $query)
{
$translate = array('nic-hdl' => 'handle', 'nameserver' => 'nserver');
$contacts = array('registrant' => 'owner', 'tech-c' => 'tech');
$r['regrinfo'] = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'Ymd');
$r['regyinfo'] = array('referrer' => 'http://www.arnes.si', 'registrar' => 'ARNES');
return $r;
}
示例8: parse
function parse($data_str, $query)
{
$translate = array('expire' => 'expires', 'nserver' => 'nserver', 'domain' => 'name', 'contact' => 'handle', 'reg-c' => '', 'descr' => 'desc', 'e-mail' => 'email', 'person' => 'name', 'role' => 'organization', 'fax-no' => 'fax');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech', 'bill-c' => 'billing', 'registrant' => 'owner');
$r['regyinfo'] = array('referrer' => 'http://www.nic.cz', 'registrar' => 'CZ-NIC');
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'dmy');
$r['regrinfo'] = $reg;
return $r;
}
示例9: parse
function parse($data_str, $query)
{
$translate = array('nic-hdl' => 'handle', 'org' => 'organization', 'e-mail' => 'email', 'person' => 'name', 'fax-no' => 'fax', 'domain' => 'name');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech', 'holder-c' => 'owner');
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'Ymd');
$r['regrinfo'] = $reg;
$r['regyinfo'] = array('referrer' => 'http://whois.nic.ir/', 'registrar' => 'NIC-IR');
return $r;
}
示例10: parse
function parse($data, $query)
{
$translate = array();
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech');
// OK-UNTIL 20131202000208
$r['regrinfo'] = generic_parser_a($data['rawdata'], $translate, $contacts);
$r['regyinfo'] = array('referrer' => 'http://nic.net.ua/', 'registrar' => 'UANIC');
return $r;
}
示例11: parse
function parse($data_str, $query)
{
$translate = array('expire' => 'expires', 'registered' => 'created', 'nserver' => 'nserver', 'domain' => 'name', 'contact' => 'handle', 'reg-c' => '', 'descr' => 'desc', 'e-mail' => 'email', 'person' => 'name', 'org' => 'organization', 'fax-no' => 'fax');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech', 'bill-c' => 'billing', 'registrant' => 'owner');
$r['regrinfo'] = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'dmy');
$r['regyinfo'] = array('referrer' => 'http://www.nic.cz', 'registrar' => 'CZ-NIC');
if ($data_str['rawdata'][0] == 'Your connection limit exceeded. Please slow down and try again later.') {
$r['regrinfo']['registered'] = 'unknown';
}
return $r;
}
示例12: parse
function parse($data_str, $query)
{
$translate = array('contact-hdl' => 'handle');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech', 'billing-c' => 'billing');
$items = array('owner:' => 'name', 'organization:' => 'organization', 'email:' => 'email', 'address:' => 'address.street', 'postal-code:' => 'address.pcode', 'city:' => 'address.city', 'state:' => 'address.state', 'country:' => 'address.country', 'reseller:' => 'sponsor.');
$r = generic_parser_a($data_str, $translate, $contacts, false, 'Ymd');
$r['owner'] = generic_parser_b($data_str, $items);
if (isset($r['owner']['sponsor'])) {
$r['domain']['sponsor'] = $r['owner']['sponsor'];
unset($r['owner']['sponsor']);
}
return $r;
}
示例13: parse
function parse($data_str, $query)
{
$translate = array('fax-no' => 'fax', 'e-mail' => 'email', 'nic-hdl' => 'handle', 'ns-list' => 'handle', 'person' => 'name', 'address' => 'address.', 'descr' => 'desc', 'anniversary' => '', 'domain' => '', 'last-update' => 'changed', 'registered' => 'created', 'country' => 'address.country', 'registrar' => 'sponsor', 'role' => 'organization');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech', 'zone-c' => 'zone', 'holder-c' => 'owner', 'nsl-id' => 'nserver');
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'dmY');
if (isset($reg['nserver'])) {
$reg['domain'] = array_merge($reg['domain'], $reg['nserver']);
unset($reg['nserver']);
}
$r['regrinfo'] = $reg;
$r['regyinfo'] = array('referrer' => 'http://www.nic.fr', 'registrar' => 'AFNIC');
return $r;
}
示例14: parse
function parse($data_str, $query)
{
$translate = array('nic-hdl' => 'handle', 'person' => 'name');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech');
$r['regyinfo'] = array('referrer' => 'http://www.domainregistry.ie', 'registrar' => 'IE Domain Registry');
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'Ymd');
if (isset($reg['domain']['descr'])) {
$reg['owner']['organization'] = $reg['domain']['descr'][0];
unset($reg['domain']['descr']);
}
$r['regrinfo'] = $reg;
return $r;
}
示例15: parse
function parse($data_str, $query)
{
$translate = array('contact-hdl' => 'handle', 'modified' => 'changed', 'reseller' => 'sponsor', 'address' => 'address.street', 'postal-code' => 'address.pcode', 'city' => 'address.city', 'state' => 'address.state', 'country' => 'address.country', 'person' => 'name', 'domain' => 'name');
$contacts = array('admin-c' => 'admin', 'tech-c' => 'tech', 'billing-c' => 'billing');
$items = array('owner' => 'name', 'organization' => 'organization', 'email' => 'email', 'phone' => 'phone', 'address' => 'address');
$r = generic_parser_a($data_str, $translate, $contacts, 'domain', 'Ymd');
foreach ($items as $tag => $convert) {
if (isset($r['domain'][$tag])) {
$r['owner'][$convert] = $r['domain'][$tag];
unset($r['domain'][$tag]);
}
}
return $r;
}