diff --git a/application/module/Helpers/Curl.php b/application/module/Helpers/Curl.php index dea71661..f801e43d 100644 --- a/application/module/Helpers/Curl.php +++ b/application/module/Helpers/Curl.php @@ -4,21 +4,25 @@ namespace Helpers; class Curl { private $options; - + public $port = 80; + public $H; + public function __construct($options = array()) { - $this->options = array_merge(array( + + } + + public function initOptions($options = array()) + { + $this->options = array_merge(array( 'debug' => false, - 'http_port' => '80', + 'http_port' => $this->port, 'user_agent' => 'Westdc DataService', 'timeout' => 20, 'curlopts' => null, 'verifyssl' => true, ), $options); - } - - public $H; - + } /** * Send a request to the server, receive a response * @@ -88,6 +92,16 @@ class Curl CURLOPT_HTTPHEADER => $headers, CURLOPT_SSL_VERIFYPEER => $options['verifyssl'], ); + + if($this->port === 443) + { + /*$curlOptions += array( + CURLOPT_SSLVERSION => 3, + CURLOPT_SSLCERT => "../application/module/Open/apache.pem", + CURLOPT_SSLKEY => "../application/module/Open/apache.key", + CURLOPT_CAINFO => "../application/module/Open/apache.pem" + );*/ + } if (ini_get('open_basedir') == '' && ini_get('safe_mode') != 'On') { $curlOptions[CURLOPT_FOLLOWLOCATION] = true; diff --git a/application/module/Helpers/Table.php b/application/module/Helpers/Table.php index 69256584..15bab0fb 100644 --- a/application/module/Helpers/Table.php +++ b/application/module/Helpers/Table.php @@ -26,5 +26,6 @@ class Table //开放平台 public $oauth_clients = "oauth_clients"; + public $oauth_token = "oauth_login_token"; public $oauth_access_tokens = "oauth_access_tokens"; } \ No newline at end of file