showWarning() public method

public showWarning ( tmchClaimData $claimData, $html = false )
$claimData tmchClaimData
コード例 #1
0
use Metaregistrar\TMCH\cnisTmchConnection;
use Metaregistrar\TMCH\tmchException;
$domain = 'nike';
$domainkey = null;
try {
    $dnl = new dnlTmchConnection();
    $dnl->setConnectionDetails('.');
    $cnis = new cnisTmchConnection();
    $cnis->setConnectionDetails('');
    $list = $dnl->getDnl();
    if (count($list) == 1) {
        echo "empty list received\n";
        echo $list[0] . "\n";
    } else {
        foreach ($list as $line) {
            if (strlen($line) > 0) {
                list($domainname, $key) = explode(',', $line);
                if ($domainname == $domain) {
                    $domainkey = $key;
                }
            }
        }
        if ($domainkey) {
            echo $cnis->showWarning($cnis->getCnis($domainkey), false);
        } else {
            echo "Domain name not found in CNIS list\n";
        }
    }
} catch (tmchException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}
コード例 #2
0
<?php

require "../autoloader.php";
use Metaregistrar\TMCH\dnlTmchConnection;
use Metaregistrar\TMCH\cnisTmchConnection;
use Metaregistrar\TMCH\tmchException;
/* This test file retrieves the latest test-domain-name-list (DNL) and gets the claim notice from the first item of this list. */
try {
    $dnl = new dnlTmchConnection();
    $dnl->setConnectionDetails('');
    $cnis = new cnisTmchConnection();
    $cnis->setConnectionDetails('');
    $list = $dnl->getDnl();
    $linecounter = -1;
    $k = array();
    foreach ($list as $line) {
        if ($linecounter > 0 && strlen($line) > 0) {
            list($domainname, $key, $datetime) = explode(',', $line);
            if ($domainname != '1' and $domainname != 'DNL') {
                echo $linecounter . ": " . $domainname . "\n";
                $k[$linecounter] = $key;
            }
        }
        $linecounter++;
    }
    echo "Enter the number from one of the labels above to display the warning notice for this label\n:";
    $number = (int) fgets(STDIN);
    echo $cnis->showWarning($cnis->getCnis($k[$number]));
} catch (tmchException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}