Skip to content

Commit 2b28b87

Browse files
committed
Add check to see if CURL is enabled.
1 parent 2a0925f commit 2b28b87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ProxmoxVE.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ public static function request(
154154
*/
155155
public function __construct($credentials)
156156
{
157+
// Check if CURL is enabled
158+
if (!function_exists('curl_version')) {
159+
throw new RuntimeException('PHP5-CURL needs to be enabled!');
160+
}
161+
157162
if ($credentials instanceof Credentials) {
158163
$this->credentials = $credentials;
159164

@@ -179,7 +184,6 @@ public function __construct($credentials)
179184
throw new \InvalidArgumentException($errorMessage);
180185
}
181186

182-
183187
$this->apiUrl = $this->credentials->getApiUrl();
184188

185189
if (!$this->authToken = $this->credentials->login()) {

0 commit comments

Comments
 (0)