File tree Expand file tree Collapse file tree 1 file changed +42
-5
lines changed Expand file tree Collapse file tree 1 file changed +42
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
+ require ('../autoloader.php ' );
3
+
4
+ use Metaregistrar \EPP \eppConnection ;
5
+ use Metaregistrar \EPP \eppException ;
6
+ use Metaregistrar \EPP \eppDomain ;
7
+ use Metaregistrar \EPP \eppDeleteDomainRequest ;
8
+
9
+ if ($ argc <= 1 ) {
10
+ echo "Usage: canceldomain.php <domainname> \n" ;
11
+ echo "Please enter the domain name that must be deleted \n\n" ;
12
+ die ();
13
+ }
14
+
15
+ $ domainname = $ argv [1 ];
16
+
17
+ try {
18
+ // Please enter your own settings file here under before using this example
19
+ if ($ conn = eppConnection::create ('' )) {
20
+ // Connect to the EPP server
21
+ if ($ conn ->login ()) {
22
+ canceldomain ($ conn , $ domainname );
23
+ $ conn ->logout ();
24
+ }
25
+ }
26
+ } catch (eppException $ e ) {
27
+ echo "ERROR: " . $ e ->getMessage () . "\n\n" ;
28
+ }
29
+
30
+
31
+
2
32
/**
3
- * Created by PhpStorm.
4
- * User: ewout
5
- * Date: 18-09-15
6
- * Time: 15:47
7
- */
33
+ * @param $conn eppConnection
34
+ * @param $domainname string
35
+ * @return null
36
+ */
37
+ function canceldomain ($ conn , $ domainname ) {
38
+ $ delete = new eppDeleteDomainRequest (new eppDomain ($ domainname ));
39
+ if ($ response = $ conn ->request ($ delete )) {
40
+ /* @var $response \Metaregistrar\EPP\eppDeleteResponse */
41
+ $ response ->dumpContents ();
42
+ }
43
+ return null ;
44
+ }
You can’t perform that action at this time.
0 commit comments