Skip to content

Commit

Permalink
Add check to see if CURL is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
zzantares committed Jun 30, 2014
1 parent 2a0925f commit 2b28b87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ProxmoxVE.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public static function request(
*/
public function __construct($credentials)
{
// Check if CURL is enabled
if (!function_exists('curl_version')) {
throw new RuntimeException('PHP5-CURL needs to be enabled!');
}

if ($credentials instanceof Credentials) {
$this->credentials = $credentials;

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


$this->apiUrl = $this->credentials->getApiUrl();

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

0 comments on commit 2b28b87

Please sign in to comment.