更新Helper\Curl和Helper\Table类

This commit is contained in:
Li Jianxuan 2013-11-21 02:14:36 +00:00
parent 608b8f29f4
commit dbe4d9d728
2 changed files with 22 additions and 7 deletions

View File

@ -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
*
@ -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;
}

View File

@ -26,5 +26,6 @@ class Table
//开放平台
public $oauth_clients = "oauth_clients";
public $oauth_token = "oauth_login_token";
public $oauth_access_tokens = "oauth_access_tokens";
}