Skip to content

Commit a2efd2e

Browse files
committed
Merge pull request #11 from jbarbede/feature/nicmx
NICMX extension (thx @jbarbede)
2 parents e675660 + f7227fe commit a2efd2e

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

src/AfriCC/EPP/AbstractFrame.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ private function getStructure()
227227
}
228228

229229
if ($this instanceof ExtensionInterface) {
230-
$this->extension = strtolower($this->className(get_class($this)));
230+
// automatically guess extension according to class name if not defined in class
231+
if (!isset($this->extension)) {
232+
$this->extension = strtolower($this->className(get_class($this)));
233+
}
234+
231235
// add to object spec
232236
ObjectSpec::$specs[$this->extension]['xmlns'] = $this->getExtensionNamespace();
233237
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the php-epp2 library.
5+
*
6+
* (c) Julien Barbedette <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE file
9+
* that was distributed with this source code.
10+
*/
11+
12+
namespace AfriCC\EPP\Extension\NICMX\Info;
13+
14+
use AfriCC\EPP\Frame\Command\Info as Info;
15+
use AfriCC\EPP\ExtensionInterface as Extension;
16+
17+
/**
18+
* @link http://www.registry.mx
19+
*/
20+
class Rar extends Info implements Extension
21+
{
22+
protected $extension_xmlns = 'http://www.nic.mx/rar-1.0';
23+
24+
public function __construct()
25+
{
26+
parent::__construct();
27+
28+
$this->set();
29+
}
30+
31+
public function getExtensionNamespace()
32+
{
33+
return $this->extension_xmlns;
34+
}
35+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the php-epp2 library.
5+
*
6+
* (c) Julien Barbedette <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE file
9+
* that was distributed with this source code.
10+
*/
11+
12+
namespace AfriCC\EPP\Extension\NICMX\Restore;
13+
14+
use AfriCC\EPP\Frame\Command\Renew as Renew;
15+
use AfriCC\EPP\ExtensionInterface as Extension;
16+
17+
/**
18+
* @link https://www.registry.mx
19+
*/
20+
class Domain extends Renew implements Extension
21+
{
22+
protected $extension = 'nicmx-domrst';
23+
protected $extension_xmlns = 'http://www.nic.mx/nicmx-domrst-1.0';
24+
25+
public function setDomain($domain)
26+
{
27+
$this->set('//epp:epp/epp:command/epp:renew/nicmx-domrst:restore/nicmx-domrst:name', $domain);
28+
}
29+
30+
public function getExtensionNamespace()
31+
{
32+
return $this->extension_xmlns;
33+
}
34+
}

0 commit comments

Comments
 (0)