From 40f73f7df8ee44fd60538a2b36c9fe71df4a74f4 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 7 Jan 2020 11:44:45 +0800 Subject: [PATCH] add clear --- common/Config.php | 19 +++++++++++++++++++ common/Miniprogarampage.php | 3 +++ 2 files changed, 22 insertions(+) diff --git a/common/Config.php b/common/Config.php index 1f80786..65a1844 100644 --- a/common/Config.php +++ b/common/Config.php @@ -111,6 +111,25 @@ class Config private $key = ''; private $access_token = ''; private $agent = ''; + private $usrSwoole = false; + + /** + * @return bool + */ + public function isUsrSwoole(): bool + { + return $this->usrSwoole; + } + + /** + * @param bool $usrSwoole + * @return Config + */ + public function setUsrSwoole(bool $usrSwoole): Config + { + $this->usrSwoole = $usrSwoole; + return $this; + } /** * @return string diff --git a/common/Miniprogarampage.php b/common/Miniprogarampage.php index 63e46a0..d6f1222 100644 --- a/common/Miniprogarampage.php +++ b/common/Miniprogarampage.php @@ -88,6 +88,9 @@ abstract class Miniprogarampage implements Progaram } static::$instance->config = $config; static::$instance->request->setAgent($config->getAgent()); + if ($config->isUsrSwoole()) { + static::$instance->request->setUseSwoole(true); + } $request = static::$instance->request; if ($request->getIsSSL()) {