1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AcquiaCloudApi\Endpoints; |
4
|
|
|
|
5
|
|
|
use AcquiaCloudApi\Connector\ClientInterface; |
6
|
|
|
use AcquiaCloudApi\Response\ApplicationResponse; |
7
|
|
|
use AcquiaCloudApi\Response\ApplicationsResponse; |
8
|
|
|
use AcquiaCloudApi\Response\DatabasesResponse; |
9
|
|
|
use AcquiaCloudApi\Response\BranchesResponse; |
10
|
|
|
use AcquiaCloudApi\Response\EnvironmentsResponse; |
11
|
|
|
use AcquiaCloudApi\Response\InsightsResponse; |
12
|
|
|
use AcquiaCloudApi\Response\TasksResponse; |
13
|
|
|
use AcquiaCloudApi\Response\OperationResponse; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Class Client |
17
|
|
|
* @package AcquiaCloudApi\CloudApi |
18
|
|
|
*/ |
19
|
|
|
class Application implements CloudApi |
20
|
|
|
{ |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Client constructor. |
24
|
|
|
* |
25
|
|
|
* @param ConnectorInterface $connector |
|
|
|
|
26
|
|
|
*/ |
27
|
|
|
public function __construct(ClientInterface $client) |
28
|
|
|
{ |
29
|
|
|
$this->client = $client; |
|
|
|
|
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Shows all applications. |
34
|
|
|
* |
35
|
|
|
* @return ApplicationsResponse |
36
|
|
|
*/ |
37
|
|
|
public function getApplications() |
38
|
|
|
{ |
39
|
|
|
return new ApplicationsResponse($this->client->request('get', '/applications')); |
|
|
|
|
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Shows information about an application. |
44
|
|
|
* |
45
|
|
|
* @param string $applicationUuid |
46
|
|
|
* @return ApplicationResponse |
47
|
|
|
*/ |
48
|
|
|
public function getApplication($applicationUuid) |
49
|
|
|
{ |
50
|
|
|
return new ApplicationResponse( |
51
|
|
|
$this->client->request( |
|
|
|
|
52
|
|
|
'get', |
53
|
|
|
"/applications/${applicationUuid}" |
54
|
|
|
) |
55
|
|
|
); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Renames an application. |
60
|
|
|
* |
61
|
|
|
* @param string $applicationUuid |
62
|
|
|
* @param string $name |
63
|
|
|
* @return OperationResponse |
64
|
|
|
*/ |
65
|
|
|
public function renameApplication($applicationUuid, $name) |
66
|
|
|
{ |
67
|
|
|
|
68
|
|
|
$options = [ |
69
|
|
|
'form_params' => [ |
70
|
|
|
'name' => $name, |
71
|
|
|
], |
72
|
|
|
]; |
73
|
|
|
|
74
|
|
|
return new OperationResponse( |
75
|
|
|
$this->client->request( |
|
|
|
|
76
|
|
|
'put', |
77
|
|
|
"/applications/${applicationUuid}", |
78
|
|
|
$options |
79
|
|
|
) |
80
|
|
|
); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Shows all code branches and tags in an application. |
85
|
|
|
* |
86
|
|
|
* @param string $applicationUuid |
87
|
|
|
* @return BranchesResponse |
88
|
|
|
*/ |
89
|
|
|
public function getBranches($applicationUuid) |
90
|
|
|
{ |
91
|
|
|
return new BranchesResponse( |
92
|
|
|
$this->client->request( |
|
|
|
|
93
|
|
|
'get', |
94
|
|
|
"/applications/${applicationUuid}/code" |
95
|
|
|
) |
96
|
|
|
); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Shows all databases in an application. |
101
|
|
|
* |
102
|
|
|
* @param string $applicationUuid |
103
|
|
|
* @return DatabasesResponse |
104
|
|
|
*/ |
105
|
|
|
public function getDatabases($applicationUuid) |
106
|
|
|
{ |
107
|
|
|
return new DatabasesResponse( |
108
|
|
|
$this->client->request( |
|
|
|
|
109
|
|
|
'get', |
110
|
|
|
"/applications/${applicationUuid}/databases" |
111
|
|
|
) |
112
|
|
|
); |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Create a new database. |
117
|
|
|
* |
118
|
|
|
* @param string $applicationUuid |
119
|
|
|
* @param string $name |
120
|
|
|
* @return OperationResponse |
121
|
|
|
*/ |
122
|
|
|
public function createDatabase($applicationUuid, $name) |
123
|
|
|
{ |
124
|
|
|
$options = [ |
125
|
|
|
'form_params' => [ |
126
|
|
|
'name' => $name, |
127
|
|
|
], |
128
|
|
|
]; |
129
|
|
|
|
130
|
|
|
return new OperationResponse( |
131
|
|
|
$this->client->request('post', "/applications/${applicationUuid}/databases", $options) |
|
|
|
|
132
|
|
|
); |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Delete a database. |
137
|
|
|
* |
138
|
|
|
* @param string $applicationUuid |
139
|
|
|
* @param string $name |
140
|
|
|
* @return OperationResponse |
141
|
|
|
*/ |
142
|
|
|
public function deleteDatabase($applicationUuid, $name) |
143
|
|
|
{ |
144
|
|
|
return new OperationResponse( |
145
|
|
|
$this->client->request('delete', "/applications/${applicationUuid}/databases/${name}") |
|
|
|
|
146
|
|
|
); |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Shows all tasks in an application. |
151
|
|
|
* |
152
|
|
|
* @param string $applicationUuid |
153
|
|
|
* @return TasksResponse |
154
|
|
|
*/ |
155
|
|
|
public function getTasks($applicationUuid) |
156
|
|
|
{ |
157
|
|
|
return new TasksResponse( |
158
|
|
|
$this->client->request( |
|
|
|
|
159
|
|
|
'get', |
160
|
|
|
"/applications/${applicationUuid}/tasks" |
161
|
|
|
) |
162
|
|
|
); |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Shows all environments in an application. |
167
|
|
|
* |
168
|
|
|
* @param string $applicationUuid |
169
|
|
|
* @return EnvironmentsResponse |
170
|
|
|
*/ |
171
|
|
|
public function getEnvironments($applicationUuid) |
172
|
|
|
{ |
173
|
|
|
return new EnvironmentsResponse( |
174
|
|
|
$this->client->request( |
|
|
|
|
175
|
|
|
'get', |
176
|
|
|
"/applications/${applicationUuid}/environments" |
177
|
|
|
) |
178
|
|
|
); |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* Show insights data from an application. |
183
|
|
|
* |
184
|
|
|
* @param string $applicationUuid |
185
|
|
|
* @return InsightsResponse |
186
|
|
|
*/ |
187
|
|
|
public function getInsights($applicationUuid) |
188
|
|
|
{ |
189
|
|
|
return new InsightsResponse( |
190
|
|
|
$this->client->request('get', "/applications/${applicationUuid}/insight") |
|
|
|
|
191
|
|
|
); |
192
|
|
|
} |
193
|
|
|
} |
194
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths