更新Helper\Curl和Helper\Table类
This commit is contained in:
parent
608b8f29f4
commit
dbe4d9d728
|
@ -4,21 +4,25 @@ namespace Helpers;
|
|||
class Curl
|
||||
{
|
||||
private $options;
|
||||
public $port = 80;
|
||||
public $H;
|
||||
|
||||
public function __construct($options = 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
|
||||
*
|
||||
|
@ -89,6 +93,16 @@ class Curl
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -26,5 +26,6 @@ class Table
|
|||
|
||||
//开放平台
|
||||
public $oauth_clients = "oauth_clients";
|
||||
public $oauth_token = "oauth_login_token";
|
||||
public $oauth_access_tokens = "oauth_access_tokens";
|
||||
}
|
Loading…
Reference in New Issue