Example #1
0
use Metaregistrar\EPP\eppResponse;
/*
 * This script polls for new messages in the EPP system
 * The messages tell you if a domain name was transferred away to another provider
 * Or it tells you that your credit balance is low
 * Please use the pollack function to acknowledge a message and remove it from the queue
 */
try {
    echo "Polling for messages\n";
    // Please enter your own settings file here under before using this example
    if ($conn = eppConnection::create('')) {
        // Connect and login to the EPP server
        if ($conn->login()) {
            $messageid = poll($conn);
            if ($messageid) {
                pollack($conn, $messageid);
            }
            $conn->logout();
        }
    }
} catch (eppException $e) {
    echo "ERROR: " . $e->getMessage() . "\n\n";
}
/**
 * @param $conn Metaregistrar\EPP\eppConnection
 * @return null|string
 */
function poll($conn)
{
    try {
        $poll = new eppPollRequest(eppPollRequest::POLL_REQ, 0);
Example #2
0
function test13($conn)
{
    $polldata = poll($conn);
    /* @var $polldata Metaregistrar\EPP\eppPollResponse */
    while ($polldata->getMessageCount() > 0) {
        pollack($conn, $polldata->getMessageId());
        $polldata = poll($conn);
    }
}