-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?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(); | ||
|
||
$params = array( | ||
'domainname' => 'test.example' | ||
); | ||
$domainReport = $epp->domainReport($params); | ||
|
||
if (array_key_exists('error', $domainReport)) | ||
{ | ||
echo 'DomainReport Error: ' . $domainReport['error'] . PHP_EOL; | ||
} | ||
else | ||
{ | ||
echo "DomainReport result: " . $domainReport['code'] . ": " . $domainReport['msg'] . PHP_EOL; | ||
} | ||
|
||
$logout = $epp->logout(); | ||
|
||
echo 'Logout Result: ' . $logout['code'] . ': ' . $logout['msg'][0] . PHP_EOL; | ||
} | ||
catch(EppException $e) | ||
{ | ||
echo 'Error: ', $e->getMessage(); | ||
} |