Created
June 18, 2013 15:30
-
-
Save caseysoftware/5806354 to your computer and use it in GitHub Desktop.
The cURL vs Streams fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (in_array('curl', get_loaded_extensions())) { | |
| $_http = new Services_Twilio_TinyHttp( | |
| "https://api.twilio.com", | |
| array("curlopts" => array( | |
| CURLOPT_USERAGENT => self::USER_AGENT, | |
| CURLOPT_HTTPHEADER => array('Accept-Charset: utf-8'), | |
| CURLOPT_CAINFO => dirname(__FILE__) . '/cacert.pem', | |
| )) | |
| ); | |
| } else { | |
| $_http = new Services_Twilio_HttpStream( | |
| "https://api.twilio.com", | |
| array( | |
| "http_options" => array( | |
| "http" => array( | |
| "user_agent" => self::USER_AGENT, | |
| "header" => "Accept-Charset: utf-8\r\n", | |
| ), | |
| "ssl" => array( | |
| 'verify_peer' => true, | |
| 'cafile' => dirname(__FILE__) . '/cacert.pem', | |
| 'verify_depth' => 5, | |
| ), | |
| ), | |
| ) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment