-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dependency injection for all objects relying on ObjectSpec (comma…
…nd frames and client) * Changed ObjectSpec to be non-static class * Removed NASK's ObjectSpec methods to better facilitate new ObjectSpec * Modified examples to use new ObjectSpec way of doing things * Removed unnecessary php-version dependent tests due to non-static ObjectSpec * Added HTTPClient connection example * Moved COZA extension example to Extension subdir in examples * Added documentation in README.md * Added recent changes to CHANGELOG.md
- Loading branch information
1 parent
f93b782
commit f3ce608
Showing
84 changed files
with
494 additions
and
2,350 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
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
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,64 @@ | ||
<?php | ||
|
||
// debug | ||
error_reporting(E_ALL); | ||
ini_set('display_errors', true); | ||
|
||
chdir(__DIR__); | ||
|
||
require '../../vendor/autoload.php'; | ||
|
||
use AfriCC\EPP\HTTPClient as EPPClient; | ||
use \AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; | ||
use AfriCC\EPP\Frame\Command\Poll; | ||
|
||
$objectSpec = new NASKObjectSpec(); | ||
$config = [ | ||
'debug' => true, | ||
'host' => 'https://app.registrar.tld', | ||
'username' => 'user', | ||
'password' => 'pass', | ||
'services' => $objectSpec->services, | ||
'serviceExtensions' => $objectSpec->serviceExtensions, | ||
//'ssl' => true, //ssl forced to true by using "https" protocol | ||
'ca_cert' => 'ca.crt', | ||
'local_cert' => 'client.crt', | ||
'pk_cert' => 'client.key', | ||
]; | ||
|
||
$epp_client = new EPPClient($config, $objectSpec); | ||
|
||
try { | ||
$greeting = $epp_client->connect(); | ||
|
||
echo $greeting; | ||
|
||
$frame = new Poll($epp_client->getObjectSpec()); //use epp client default objectspec | ||
$frame->request(); | ||
|
||
$response = $epp_client->request($frame); | ||
|
||
while($response->success() && $response->code() !== 1300 ){ // 1300 = result successful, no more mesages | ||
|
||
echo "Epp Poll message ID: "; | ||
echo $response->queueId(); | ||
echo "\n"; | ||
echo "Epp Poll Message: "; | ||
echo $response->queueMessage(); | ||
|
||
$ackFrame = new Poll($epp_client->getObjectSpec()); | ||
$ackFrame->ack($response->queueId()); | ||
$ackResponse = $epp_client->request($ackFrame); | ||
if(!$ackResponse->success()){ | ||
echo "Couldn't ACK poll message\n"; | ||
break; // no ack! | ||
} | ||
$response= $client->request($frame); //reuse already existing poll request frame | ||
} | ||
} catch (Exception $e) { | ||
echo $e->getMessage() . PHP_EOL; | ||
unset($epp_client); | ||
exit(1); | ||
} | ||
|
||
$epp_client->close(); |
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
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
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,16 @@ | ||
<?php | ||
|
||
// debug | ||
error_reporting(E_ALL); | ||
ini_set('display_errors', true); | ||
|
||
chdir(__DIR__); | ||
|
||
require '../../../vendor/autoload.php'; | ||
|
||
use AfriCC\EPP\Extension\COZA\Update\CozaContact as CozaContactUpdateExtension; | ||
|
||
$frame = new CozaContactUpdateExtension(); | ||
$frame->setId('MyContact'); | ||
$frame->cancelPendingAction(); | ||
echo $frame; |
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
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
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
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
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
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
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
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
Oops, something went wrong.