Skip to content

Commit

Permalink
Added Nicmx extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarbede committed Apr 23, 2015
1 parent 07e0c42 commit 36629cd
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/AfriCC/EPP/AbstractFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ private function getStructure()
}

if ($this instanceof ExtensionInterface) {
$this->extension = strtolower($this->className(get_class($this)));
//Automatically guess extension according to class name if not defined in class.
//I do that for nicmx-domrst extension, maybe there is a cleaner solution.
if (!isset($this->extension)) {

This comment has been minimized.

Copy link
@lifeofguenter

lifeofguenter Apr 25, 2015

Solid!

$this->extension = strtolower($this->className(get_class($this)));
}

// add to object spec
ObjectSpec::$specs[$this->extension]['xmlns'] = $this->getExtensionNamespace();
}
Expand Down
35 changes: 35 additions & 0 deletions src/AfriCC/EPP/Extension/NICMX/Info/Rar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/**
* This file is part of the php-epp2 library.
*
* (c) Gunter Grodotzki <[email protected]>

This comment has been minimized.

Copy link
@lifeofguenter

lifeofguenter Apr 25, 2015

Please change this.

*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/

namespace AfriCC\EPP\Extension\NICMX\Info;

use AfriCC\EPP\Frame\Command\Info as Info;
use AfriCC\EPP\ExtensionInterface as Extension;

/**
* @link https://www.registry.net.za/content.php?wiki=1&contentid=18&title=EPP%20Contact%20Extensions

This comment has been minimized.

Copy link
@lifeofguenter

lifeofguenter Apr 25, 2015

Please change this.

*/
class Rar extends Info implements Extension
{
protected $extension_xmlns = 'http://www.nic.mx/rar-1.0';

public function __construct()
{
parent::__construct();

$this->set(null, '');

This comment has been minimized.

Copy link
@lifeofguenter

lifeofguenter Apr 25, 2015

->set() should be sufficient

}

public function getExtensionNamespace()
{
return $this->extension_xmlns;
}
}
31 changes: 31 additions & 0 deletions src/AfriCC/EPP/Extension/NICMX/Restore/Domain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/**
* This file is part of the php-epp2 library.
*
* (c) Gunter Grodotzki <[email protected]>

This comment has been minimized.

Copy link
@lifeofguenter

lifeofguenter Apr 25, 2015

Please change this.

*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/

namespace AfriCC\EPP\Extension\NICMX\Restore;

use AfriCC\EPP\Frame\Command\Renew as Renew;
use AfriCC\EPP\ExtensionInterface as Extension;

class Domain extends Renew implements Extension
{
protected $extension = 'nicmx-domrst';
protected $extension_xmlns = 'http://www.nic.mx/nicmx-domrst-1.0';

public function setDomain($domain)
{
$this->set('//epp:epp/epp:command/epp:renew/nicmx-domrst:restore/nicmx-domrst:name', $domain);
}

public function getExtensionNamespace()
{
return $this->extension_xmlns;
}
}

2 comments on commit 36629cd

@lifeofguenter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I just did a full review. Looks pretty solid - amazing understanding of the library. Would be happy to PR after the minor changes are done.

@jbarbede
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe great, I'll do these minor changes and send you the PR.

Please sign in to comment.