Skip to content

Commit

Permalink
Create KeepAlive.php
Browse files Browse the repository at this point in the history
  • Loading branch information
getpinga authored Feb 16, 2023
1 parent f5a341f commit 594feb2
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions examples/KeepAlive.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Tembo EPP client test file
*
* Written in 2023 by Taras Kondratyuk (https://getpinga.com)
* Based on xpanel/epp-bundle written in 2019 by Lilian Rudenco ([email protected])
*
* @license MIT
*/

// Include the Composer autoloader
require_once '../vendor/autoload.php';
require_once 'Connection.php';

// Use the Epp class from your package
use Pinga\Tembo\Epp;
use Pinga\Tembo\EppClient;
use Pinga\Tembo\HttpsClient;

try
{
$epp = connectEpp();

$startTime = time();
$endTime = $startTime + 1800; // 30 minutes from start time

while (time() < $endTime) {
$hello = $epp->hello();
echo 'Keep-alive Result: ' . PHP_EOL . $hello . PHP_EOL;
sleep(600); // wait for 10 minutes
}

$logout = $epp->logout();
echo 'Logout Result: ' . $logout['code'] . ': ' . $logout['msg'][0] . PHP_EOL;
}
catch(EppException $e)
{
echo 'Error: ', $e->getMessage();
}

0 comments on commit 594feb2

Please sign in to comment.