File tree Expand file tree Collapse file tree 3 files changed +74
-1
lines changed Expand file tree Collapse file tree 3 files changed +74
-1
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments