Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/DNS/delete_dns_records.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

require_once("../config.php");

$params = array(
'id'=>'',
);

$request = new \pmill\Plesk\DeleteDNSRecords($config, $params);
$info = $request->process();

var_dump($info);
44 changes: 44 additions & 0 deletions src/pmill/Plesk/DeleteDNSRecords.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
namespace pmill\Plesk;

class DeleteDatabase extends BaseRequest
Copy link
Owner

Choose a reason for hiding this comment

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

Looks like you forgot to change the class name.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, sorry, :)

Copy link
Author

Choose a reason for hiding this comment

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

I haved changed the class name

{
/**
* @var string
*/
public $xml_packet = <<<EOT
<?xml version="1.0"?>
<packet>
<dns>
<del-rec>
<filter>
<id>{ID}</id>
</filter>
</del-rec>
</dns>
</packet>
EOT;

/**
* @var array
*/
protected $default_params = [
'id' => null,
];

/**
* @param $xml
* @return bool
* @throws ApiRequestException
*/
protected function processResponse($xml)
{
$result = $xml->dns->{'del-rec'}->result;

if ($result->status == 'error') {
throw new ApiRequestException($result);
}

return true;
}
}
8 changes: 4 additions & 4 deletions src/pmill/Plesk/GetSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ class GetSite extends BaseRequest
*/
public $xml_packet = <<<EOT
<?xml version="1.0"?>
<packet version="1.6.0.0">
<domain>
<packet version="1.6.7.0">
<site>
<get>
<filter>
<domain-name>{DOMAIN}</domain-name>
<name>{DOMAIN}</name>
</filter>
<dataset>
<hosting/>
</dataset>
</get>
</domain>
</site>
</packet>
EOT;

Expand Down