function __construct($apiKey) { $this->apiKey = TextRazorSettings::getApiKey(); $this->endPoint = TextRazorSettings::getEndPoint(); $this->secureEndPoint = TextRazorSettings::getSecureEndpoint(); $this->enableEncryption = TextRazorSettings::getEnableEncryption(); $this->enableCompression = TextRazorSettings::getEnableCompression(); if (isset($apiKey)) { $this->apiKey = $apiKey; } if (!is_string($this->apiKey)) { throw new Exception('TextRazor Error: Invalid API key'); } if (!function_exists('curl_version')) { throw new Exception('TextRazor Error: TextRazor requires cURL support to be enabled on your PHP installation'); } }