add clear
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ class Container
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \common\Config $config
|
||||
* @param wchat\common\Config $config
|
||||
* @return $this
|
||||
*/
|
||||
public function generate(Config $config)
|
||||
|
||||
@@ -278,7 +278,7 @@ class HttpClient
|
||||
private function request($url, $data = [])
|
||||
{
|
||||
$data = $this->paramEncode($data);
|
||||
if ($this->use_swoole && $this->isCli()) {
|
||||
if ($this->use_swoole || $this->isCli()) {
|
||||
[$url, $host] = $this->parseUrlHost($url);
|
||||
return $this->coroutine($host, $url, $data);
|
||||
} else {
|
||||
|
||||
@@ -73,9 +73,6 @@ abstract class Miniprogarampage implements Progaram
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->request = HttpClient::NewRequest();
|
||||
$this->request->setIsSSL(true);
|
||||
$this->request->setData(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,6 +103,9 @@ abstract class Miniprogarampage implements Progaram
|
||||
public function initConfig($config)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->request = HttpClient::NewRequest();
|
||||
$this->request->setIsSSL(true);
|
||||
$this->request->setData(null);
|
||||
$this->request->setUseSwoole($config->isUsrSwoole());
|
||||
$this->request->setAgent($config->getAgent());
|
||||
if (!empty($config->getSslCert())) {
|
||||
@@ -118,7 +118,7 @@ abstract class Miniprogarampage implements Progaram
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \common\Config
|
||||
* @return \wchat\common\Config
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user