Skip to content

Commit

Permalink
Merge 70127af into 3b3aeb9
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-bit committed Oct 20, 2019
2 parents 3b3aeb9 + 70127af commit f37fd06
Show file tree
Hide file tree
Showing 90 changed files with 5,063 additions and 96 deletions.
392 changes: 299 additions & 93 deletions composer.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions examples/Extension/NASK/_autoload.php
@@ -0,0 +1,3 @@
<?php

require '../../../vendor/autoload.php';
20 changes: 20 additions & 0 deletions examples/Extension/NASK/check_future.php
@@ -0,0 +1,20 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\Check\Future as CheckFuture;
use AfriCC\EPP\Extension\NASK\ObjectSpec;

ObjectSpec::overwriteParent();

$frame = new CheckFuture();
$frame->addFuture('ala.pl');
$frame->addFuture('ela.com.pl');
$frame->addFuture('ola.org');

echo $frame;
20 changes: 20 additions & 0 deletions examples/Extension/NASK/create_future.php
@@ -0,0 +1,20 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\Create\Future as CreateFuture;
use AfriCC\EPP\Extension\NASK\ObjectSpec;

ObjectSpec::overwriteParent();

$frame = new CreateFuture();
$frame->setFuture('example.pl');
$frame->setPeriod('3y');
$frame->setRegistrant('jd1234');
$frame->setAuthInfo('2fooBAR');
echo $frame;
17 changes: 17 additions & 0 deletions examples/Extension/NASK/delete_future.php
@@ -0,0 +1,17 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\Delete\Future as DeleteFuture;
use AfriCC\EPP\Extension\NASK\ObjectSpec;

ObjectSpec::overwriteParent();

$frame = new DeleteFuture();
$frame->setFuture('futuretest.pl');
echo $frame;
18 changes: 18 additions & 0 deletions examples/Extension/NASK/info_future.php
@@ -0,0 +1,18 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\Info\Future as InfoFuture;
use AfriCC\EPP\Extension\NASK\ObjectSpec;

ObjectSpec::overwriteParent();

$frame = new InfoFuture();
$frame->setFuture('example.pl');
$frame->setAuthInfo('2fooBAR');
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/renew_future.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Renew\Future as RenewFuture;

ObjectSpec::overwriteParent();

$frame = new RenewFuture();
$frame->setFuture('example.pl');
$frame->setCurrentExpirationDate('2010-10-30');
$frame->setPeriod('3y');
echo $frame;
18 changes: 18 additions & 0 deletions examples/Extension/NASK/report_basic.php
@@ -0,0 +1,18 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report;

ObjectSpec::overwriteParent();

$frame = new Report();
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/report_cancel.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\Cancel as ReportCancel;

ObjectSpec::overwriteParent();

$frame = new ReportCancel();
$frame->setReportId('e264a95d-0ba0-40f1-a0e0-97407fd5cdbe');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/report_contact.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\Contact as ReportContact;

ObjectSpec::overwriteParent();

$frame = new ReportContact();
$frame->setContactId('k13');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
23 changes: 23 additions & 0 deletions examples/Extension/NASK/report_domain.php
@@ -0,0 +1,23 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\Domain as ReportDomain;

ObjectSpec::overwriteParent();

$frame = new ReportDomain();
$frame->setState('STATE_REGISTERED');
$frame->setExDate('2007-05-07T11:23:00.0Z');
$frame->addStatus('serverHold');
$frame->setStatusesIn(true);
$frame->addStatus('clientHold');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/report_future.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\Future as ReportFuture;

ObjectSpec::overwriteParent();

$frame = new ReportFuture();
$frame->setExDate('2007-04-23T15:22:34.0Z');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/report_getdata.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\GetData as ReportGetData;

ObjectSpec::overwriteParent();

$frame = new ReportGetData();
$frame->setReportId('58ab3bd1-fcce-4c03-b159-8af5f1adb447');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/report_host.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\Host as ReportHost;

ObjectSpec::overwriteParent();

$frame = new ReportHost();
$frame->setName('ns1.temp.pl');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/report_prepaid_paymentfunds.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\Prepaid as ReportPaymentFunds;

ObjectSpec::overwriteParent();

$frame = new ReportPaymentFunds();
$frame->setFundsAccountType('DOMAIN');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/report_prepaid_payments.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Report\Prepaid as ReportPayments;

ObjectSpec::overwriteParent();

$frame = new ReportPayments();
$frame->setPaymentsAccountType('DOMAIN');
$frame->setOffset(0);
$frame->setLimit(50);
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/transfer_future.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Transfer\Future as TransferFuture;

ObjectSpec::overwriteParent();

$frame = new TransferFuture();
$frame->setOperation('request');
$frame->setFuture('example.pl');
$frame->setAuthInfo('2fooBAR');
echo $frame;
20 changes: 20 additions & 0 deletions examples/Extension/NASK/transfer_future_resend.php
@@ -0,0 +1,20 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Transfer\Future as TransferFuture;

ObjectSpec::overwriteParent();

$frame = new TransferFuture();
$frame->setOperation('request');
$frame->setFuture('example.pl');
$frame->setAuthInfo('2fooBAR');
$frame->resendConfirmationRequest();
echo $frame;
19 changes: 19 additions & 0 deletions examples/Extension/NASK/update_future.php
@@ -0,0 +1,19 @@
<?php

// debug
error_reporting(E_ALL);
ini_set('display_errors', true);

chdir(__DIR__);

require './_autoload.php';
use AfriCC\EPP\Extension\NASK\ObjectSpec;
use AfriCC\EPP\Extension\NASK\Update\Future as UpdateFuture;

ObjectSpec::overwriteParent();

$frame = new UpdateFuture();
$frame->setFuture('example7.pl');
$frame->changeRegistrant('mak21');
$frame->changeAuthInfo('2fooBAR');
echo $frame;
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Expand Up @@ -12,6 +12,8 @@
<testsuites>
<testsuite name="AfriCC/EPP Test Suite">
<directory suffix="Test.php">./tests</directory>
<directory suffix="Test5x.php" phpVersion="7.0.0" phpVersionOperator="&lt;">./tests</directory>
<directory suffix="Test7x.php" phpVersion="7.0.0" phpVersionOperator=">=">./tests</directory>
</testsuite>
</testsuites>
<filter>
Expand Down
10 changes: 9 additions & 1 deletion src/AfriCC/EPP/AbstractFrame.php
Expand Up @@ -22,11 +22,18 @@
abstract class AbstractFrame extends DOMDocument implements FrameInterface
{
protected $xpath;
/**
* @var \DOMElement[]
*/
protected $nodes;
protected $format;
protected $command;
protected $mapping;
protected $extension;
/**
* @var bool whether to ignore command part when building realxpath
*/
protected $ignore_command = false;

/**
* Construct (with import if specified) frame
Expand Down Expand Up @@ -152,6 +159,7 @@ protected function createNodes($path)
++$next_key;
$path_parts[$i] = sprintf('%s:%s[%d]', $node_ns, $node_name, $next_key);
}

if (preg_match('/^(.*)\[(\d+)\]$/', $node_name, $matches)) {
// direct node-array access
$node_name = $matches[1];
Expand Down Expand Up @@ -220,7 +228,7 @@ protected function realxpath($path)
array_unshift($path_parts, $this->mapping . ':' . $this->command);
}

if (!empty($this->command)) {
if (!empty($this->command) && !$this->ignore_command) {
array_unshift($path_parts, 'epp:' . $this->command);
}

Expand Down
7 changes: 7 additions & 0 deletions src/AfriCC/EPP/Extension.php
@@ -0,0 +1,7 @@
<?php

namespace AfriCC\EPP;

class Extension extends AbstractFrame
{
}

0 comments on commit f37fd06

Please sign in to comment.