private function createMergedCurlOpts($request)
    {
        // Merge default CURL options with overwritable CURL options
        $mergedCurlOpts = [
            // see: http://curl.haxx.se/docs/sslcerts.html
            CURLOPT_CAINFO => __DIR__ . '/../../../../resources/cacert.pem',
            CURLOPT_SSL_VERIFYHOST => 2,
            CURLOPT_SSL_VERIFYPEER => true
        ];

        foreach($this->additionalCurlOpts as $option => $value) {
            $mergedCurlOpts[$option] = $value;
        }

        // Set not overwritable CURL options
        $mergedCurlOpts[CURLOPT_RETURNTRANSFER] = true;
        $mergedCurlOpts[CURLOPT_ENCODING] = 'gzip, deflate';
        $mergedCurlOpts[CURLOPT_POST] = true;
        $mergedCurlOpts[CURLOPT_POSTFIELDS] = $request;
        $mergedCurlOpts[CURLOPT_HTTPHEADER] = [
            'Content-Type: application/json',
            'Content-Length: ' . strlen($request)
        ];

        return $mergedCurlOpts;
    }
private function createMergedCurlOpts($request)
    {
        // Merge default CURL options with overwritable CURL options
        $mergedCurlOpts = [
            // see: http://curl.haxx.se/docs/sslcerts.html
            CURLOPT_CAINFO => __DIR__ . '/../../../../resources/cacert.pem',
            CURLOPT_SSL_VERIFYHOST => 2,
            CURLOPT_SSL_VERIFYPEER => true
        ];

        foreach($this->additionalCurlOpts as $option => $value) {
            $mergedCurlOpts[$option] = $value;
        }

        // Set not overwritable CURL options
        $mergedCurlOpts[CURLOPT_RETURNTRANSFER] = true;
        $mergedCurlOpts[CURLOPT_ENCODING] = 'gzip, deflate';
        $mergedCurlOpts[CURLOPT_POST] = true;
        $mergedCurlOpts[CURLOPT_POSTFIELDS] = $request;
        $mergedCurlOpts[CURLOPT_HTTPHEADER] = [
            'Content-Type: application/json',
            'Content-Length: ' . strlen($request)
        ];

        return $mergedCurlOpts;
    }
private function createMergedCurlOpts ( $ request ) { // Merge default CURL options with overwritable CURL options $ mergedCurlOpts = [ // see: http://curl.haxx.se/docs/sslcerts.html CURLOPT_CAINFO => __DIR__ . '/../../../../resources/cacert.pem' , CURLOPT_SSL_VERIFYHOST => 2 , CURLOPT_SSL_VERIFYPEER => true ] ; foreach ( $ this -> additionalCurlOpts as $ option => $ value ) { $ mergedCurlOpts [ $ option ] = $ value ; } // Set not overwritable CURL options $ mergedCurlOpts [ CURLOPT_RETURNTRANSFER ] = true ; $ mergedCurlOpts [ CURLOPT_ENCODING ] = 'gzip, deflate' ; $ mergedCurlOpts [ CURLOPT_POST ] = true ; $ mergedCurlOpts [ CURLOPT_POSTFIELDS ] = $ request ; $ mergedCurlOpts [ CURLOPT_HTTPHEADER ] = [ 'Content-Type: application/json' , 'Content-Length: ' . strlen ( $ request ) ] ; return $ mergedCurlOpts ; }
Utility function used to create a set of CURL options from additional CURL options defined on the CURL client and
not overwritable CURL options.

@param array $request the request to POST to the Pushwoosh Web Services.

@return array the resulting CURL options to use.
Utility function used to create a set of CURL options from additional CURL options defined on the CURL client and not overwritable CURL options .