1
|
|
|
<?php |
2
|
|
|
// Copyright 1999-2016. Parallels IP Holdings GmbH. |
3
|
|
|
|
4
|
|
|
namespace PleskX\Api\Operator; |
5
|
|
|
use PleskX\Api\Struct\Aps as Struct; |
6
|
|
|
|
7
|
|
|
class Aps extends \PleskX\Api\Operator |
8
|
|
|
{ |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @param array $properties |
|
|
|
|
12
|
|
|
* @return Struct\Info |
13
|
|
|
*/ |
14
|
|
|
public function create(array $domaininfo,array $package,array $database,array $settings) |
15
|
|
|
{ |
16
|
|
|
$packet = $this->_client->getPacket(); |
17
|
|
|
|
18
|
|
|
$infoInstall = $packet->addChild($this->_wrapperTag)->addChild('install'); |
19
|
|
|
|
20
|
|
|
foreach ($domaininfo as $name => $value) { |
21
|
|
|
$infoInstall->addChild($name, $value); |
22
|
|
|
} |
23
|
|
|
$infoPackage = $infoInstall->addChild('package'); |
24
|
|
|
foreach($package as $name => $value) |
25
|
|
|
{ |
26
|
|
|
$infoPackage->addChild($name,$value); |
27
|
|
|
} |
28
|
|
|
$infoInstall->addChild('ssl', true); |
29
|
|
|
|
30
|
|
|
$infoDatabase = $infoInstall->addChild('database'); |
31
|
|
|
foreach($database as $name => $value) |
32
|
|
|
{ |
33
|
|
|
|
34
|
|
|
$infoDatabase->addChild($name,$value); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
$infoSettings = $infoInstall->addChild('settings'); |
38
|
|
|
foreach($settings as $settings_array => $setting_array) |
39
|
|
|
{ |
40
|
|
|
$infoSetting = $infoSettings->addChild('setting'); |
41
|
|
|
foreach($setting_array as $name => $value) |
42
|
|
|
{ |
43
|
|
|
$infoSetting->addChild($name,$value); |
44
|
|
|
} |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
$response = $this->_client->request($packet); |
48
|
|
|
|
49
|
|
|
$info = new Struct\Info($response); |
50
|
|
|
|
51
|
|
|
return $info; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @param string $field |
56
|
|
|
* @param integer|string $value |
57
|
|
|
* @return bool |
58
|
|
|
*/ |
59
|
|
|
public function delete($field, $value) |
60
|
|
|
{ |
61
|
|
|
return $this->_delete($field, $value); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @param string $field |
66
|
|
|
* @param integer|string $value |
67
|
|
|
* @return Struct\GeneralInfo |
68
|
|
|
*/ |
69
|
|
|
public function get($field, $value) |
70
|
|
|
{ |
71
|
|
|
$items = $this->_getItems(Struct\GeneralInfo::class, 'install', $field, $value); |
72
|
|
|
return reset($items); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @return Struct\GeneralInfo[] |
77
|
|
|
*/ |
78
|
|
|
public function getAll() |
79
|
|
|
{ |
80
|
|
|
return $this->_getItems(Struct\GeneralInfo::class, 'aps'); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
} |
84
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.