From 8e154a61dd57287c1ca2d8142634b913b1be516b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Fri, 3 Sep 2021 16:50:22 +0800 Subject: [PATCH 01/10] no message --- src/Api/ApiServiceProvider.php | 46 ++++++++++++++++++++++++++-------- src/Base/DzqModel.php | 25 ++++-------------- 2 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/Api/ApiServiceProvider.php b/src/Api/ApiServiceProvider.php index 2e008c2..d7f6feb 100644 --- a/src/Api/ApiServiceProvider.php +++ b/src/Api/ApiServiceProvider.php @@ -18,6 +18,7 @@ namespace Discuz\Api; +use App\Common\Utils; use Discuz\Api\Controller\AbstractSerializeController; use Discuz\Api\Events\ApiExceptionRegisterHandler; use Discuz\Api\Events\ConfigMiddleware; @@ -103,16 +104,39 @@ class ApiServiceProvider extends ServiceProvider protected function populateRoutes(RouteCollection $route) { - $route->group('/api', function (RouteCollection $route) { - require $this->app->basePath('routes/api.php'); - }); - - $route->group('/apiv3', function (RouteCollection $route) { - require $this->app->basePath('routes/apiv3.php'); - }); - - $route->group('/api/backAdmin', function (RouteCollection $route) { - require $this->app->basePath('routes/apiadmin.php'); - }); + $uri = $_SERVER['REQUEST_URI']; + $uri = str_replace('/', '', $uri); + if (strpos($uri, 'api') === 0) { + $route->group('/api', function (RouteCollection $route) { + require $this->app->basePath('routes/api.php'); + }); + $route->group('/api/backAdmin', function (RouteCollection $route) { + require $this->app->basePath('routes/apiadmin.php'); + }); + } else if (strpos($uri, 'apiv3') === 0) { + $route->group('/apiv3', function (RouteCollection $route) { + require $this->app->basePath('routes/apiv3.php'); + }); + } else if (strpos($uri, 'plugin') === 0 && strpos($uri, 'api')) { + $plugins = Utils::getPluginList(); + $originUrl = $_SERVER['REQUEST_URI']; + preg_match("/(?<=plugin\/).*?(?=\/api)/", $originUrl, $m); + $pluginName = $m[0]; + $route->group('/api', function (RouteCollection $route) { + require $this->app->basePath('routes/api.php'); + }); + foreach ($plugins as $plugin) { + if (strtolower($pluginName) == strtolower($plugin['name_en'])) { + $route->group('/plugin/' . $plugin['name_en'] . '/api/', function (RouteCollection $route) use ($plugin) { + $routes = $plugin['routes']; + foreach ($routes as $name => $info) { + $method = strtolower($info['method']); + $route->$method($name, $plugin['name_en'] .'.'. str_replace('/', '.', $name), $info['controller']); + } + }); + break; + } + } + } } } diff --git a/src/Base/DzqModel.php b/src/Base/DzqModel.php index a96f38c..d92c836 100644 --- a/src/Base/DzqModel.php +++ b/src/Base/DzqModel.php @@ -23,7 +23,11 @@ use Illuminate\Support\Facades\URL; abstract class DzqModel extends Model { - + public function __construct(array $attributes = []) + { + //检查数据表合法性 + parent::__construct($attributes); + } private static $instance; public static function instance() @@ -38,37 +42,18 @@ abstract class DzqModel extends Model public function save(array $options = []) { - $original = $this->original; - $attr = $this->attributes; - unset($original['updated_at']); - unset($attr['updated_at']); - if ($original != $attr) { - $this->clearCache(); - } return parent::save($options); // TODO: Change the autogenerated stub } public function delete() { - $this->clearCache(); return parent::delete(); // TODO: Change the autogenerated stub } public function update(array $attributes = [], array $options = []) { - $original = $this->original; - $attr = $this->attributes; - unset($original['updated_at']); - unset($attr['updated_at']); - if ($original != $attr) { - $this->clearCache(); - } return parent::update($attributes, $options); // TODO: Change the autogenerated stub } - protected function clearCache() - { - //todo 缓存池数据变更 - } } -- Gitee From 60c40c344e00726e18241cf3cf612caf20c1e28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Wed, 8 Sep 2021 16:41:46 +0800 Subject: [PATCH 02/10] no message --- src/Api/ApiServiceProvider.php | 58 ++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/src/Api/ApiServiceProvider.php b/src/Api/ApiServiceProvider.php index d7f6feb..f47dcf3 100644 --- a/src/Api/ApiServiceProvider.php +++ b/src/Api/ApiServiceProvider.php @@ -104,38 +104,42 @@ class ApiServiceProvider extends ServiceProvider protected function populateRoutes(RouteCollection $route) { - $uri = $_SERVER['REQUEST_URI']; - $uri = str_replace('/', '', $uri); - if (strpos($uri, 'api') === 0) { - $route->group('/api', function (RouteCollection $route) { - require $this->app->basePath('routes/api.php'); + $reqUri = ''; + if (isset($_SERVER['REQUEST_URI'])) { + $reqUri = $_SERVER['REQUEST_URI']; + $uri = str_replace('/', '', $reqUri); + } + $route->group('/api', function (RouteCollection $route) { + require $this->app->basePath('routes/api.php'); + }); + if (strpos($uri, 'apiv3') === 0) { + $route->group('/apiv3', function (RouteCollection $route) { + require $this->app->basePath('routes/apiv3.php'); }); + } else if (strpos($uri, 'api') === 0) { $route->group('/api/backAdmin', function (RouteCollection $route) { require $this->app->basePath('routes/apiadmin.php'); }); - } else if (strpos($uri, 'apiv3') === 0) { - $route->group('/apiv3', function (RouteCollection $route) { - require $this->app->basePath('routes/apiv3.php'); - }); } else if (strpos($uri, 'plugin') === 0 && strpos($uri, 'api')) { - $plugins = Utils::getPluginList(); - $originUrl = $_SERVER['REQUEST_URI']; - preg_match("/(?<=plugin\/).*?(?=\/api)/", $originUrl, $m); - $pluginName = $m[0]; - $route->group('/api', function (RouteCollection $route) { - require $this->app->basePath('routes/api.php'); - }); - foreach ($plugins as $plugin) { - if (strtolower($pluginName) == strtolower($plugin['name_en'])) { - $route->group('/plugin/' . $plugin['name_en'] . '/api/', function (RouteCollection $route) use ($plugin) { - $routes = $plugin['routes']; - foreach ($routes as $name => $info) { - $method = strtolower($info['method']); - $route->$method($name, $plugin['name_en'] .'.'. str_replace('/', '.', $name), $info['controller']); - } - }); - break; - } + $this->setPluginRoutes($route, $reqUri); + } + } + + private function setPluginRoutes($route, $reqUri) + { + $plugins = Utils::getPluginList(); + preg_match("/(?<=plugin\/).*?(?=\/api)/", $reqUri, $m); + $pluginName = $m[0]; + foreach ($plugins as $plugin) { + if (strtolower($pluginName) == strtolower($plugin['name_en'])) { + $route->group('/plugin/' . $plugin['name_en'] . '/api/', function (RouteCollection $route) use ($plugin) { + $routes = $plugin['routes']; + foreach ($routes as $name => $info) { + $method = strtolower($info['method']); + $route->$method($name, $plugin['name_en'] . '.' . str_replace('/', '.', $name), $info['controller']); + } + }); + break; } } } -- Gitee From dcaab2c5e5af3c08b3d4c751d48b0e6a3999a213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Wed, 8 Sep 2021 20:45:49 +0800 Subject: [PATCH 03/10] no message --- src/Api/ApiServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Api/ApiServiceProvider.php b/src/Api/ApiServiceProvider.php index f47dcf3..3dec204 100644 --- a/src/Api/ApiServiceProvider.php +++ b/src/Api/ApiServiceProvider.php @@ -104,10 +104,10 @@ class ApiServiceProvider extends ServiceProvider protected function populateRoutes(RouteCollection $route) { - $reqUri = ''; + $reqUri = '';$uri=''; if (isset($_SERVER['REQUEST_URI'])) { $reqUri = $_SERVER['REQUEST_URI']; - $uri = str_replace('/', '', $reqUri); + $uri = str_replace(['/',' '], ['',''], $reqUri); } $route->group('/api', function (RouteCollection $route) { require $this->app->basePath('routes/api.php'); -- Gitee From 7c287139d016f9adefe9df5f104b52e5700201fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Fri, 10 Sep 2021 14:55:46 +0800 Subject: [PATCH 04/10] no message --- src/Base/DzqPluginMigration.php | 26 ++++++++++++++++++++++++++ src/Base/DzqPluginSeeder.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/Base/DzqPluginMigration.php create mode 100644 src/Base/DzqPluginSeeder.php diff --git a/src/Base/DzqPluginMigration.php b/src/Base/DzqPluginMigration.php new file mode 100644 index 0000000..40e0333 --- /dev/null +++ b/src/Base/DzqPluginMigration.php @@ -0,0 +1,26 @@ + Date: Wed, 15 Sep 2021 17:30:24 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/Server.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Http/Server.php b/src/Http/Server.php index 103ce98..593c547 100644 --- a/src/Http/Server.php +++ b/src/Http/Server.php @@ -47,6 +47,7 @@ class Server extends SiteApp $pipe = new MiddlewarePipe(); $pipe->pipe(new RequestHandler([ + '/plugin'=>'discuz.api.middleware', '/api' => 'discuz.api.middleware', '/' => 'discuz.web.middleware' ], $this->app)); -- Gitee From bae565046cca46a0f0833176bb852bdddb450cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Wed, 15 Sep 2021 17:35:45 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Base/DzqController.php | 16 ---------------- src/Common/Utils.php | 14 +++++--------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/Base/DzqController.php b/src/Base/DzqController.php index 9126cfa..889df85 100644 --- a/src/Base/DzqController.php +++ b/src/Base/DzqController.php @@ -145,22 +145,6 @@ abstract class DzqController implements RequestHandlerInterface return $p; } - private function specialParamsChars(&$params) - { - return true; - if (is_array($params)) { - foreach ($params as &$item) { - if (is_array($item)) { - $this->specialParamsChars($item); - } else if (is_string($item)) { - $item = htmlspecialchars($item); - } - } - } else if (is_string($params)) { - $params = htmlspecialchars($params); - } - return $params; - } /* * 接口出参 diff --git a/src/Common/Utils.php b/src/Common/Utils.php index 4437989..38b374c 100644 --- a/src/Common/Utils.php +++ b/src/Common/Utils.php @@ -144,7 +144,7 @@ class Utils app('log')->info('result error:' . $code.' api:'.$request->getUri()->getPath().' msg:'.$msg); } - $data = [ + $ret = [ 'Code' => $code, 'Message' => $msg, 'Data' => $data, @@ -154,10 +154,10 @@ class Utils if (strpos($api, 'backAdmin') === 0) { DzqLog::inPut(DzqLog::LOG_ADMIN); - DzqLog::outPut($data, DzqLog::LOG_ADMIN); + DzqLog::outPut($ret, DzqLog::LOG_ADMIN); } elseif (! empty($dzqLog['openApiLog'])) { DzqLog::inPut(DzqLog::LOG_API); - DzqLog::outPut($data, DzqLog::LOG_API); + DzqLog::outPut($ret, DzqLog::LOG_API); } $crossHeaders = DiscuzResponseFactory::getCrossHeaders(); @@ -165,11 +165,7 @@ class Utils header($k . ':' . $v); } header('Content-Type:application/json; charset=utf-8', true, 200); - $t1 = DISCUZ_START; - $t2 = microtime(true); - header('Dzq-CostTime:'.(($t2 - $t1)*1000).'ms'); -// header('Dzq-DB-CostTime:'.$GLOBALS["mysql_time"].'ms'); - - exit(json_encode($data, 256)); + header('Dzq-CostTime:'.((microtime(true) - DISCUZ_START)*1000).'ms'); + exit(json_encode($ret, 256)); } } -- Gitee From c60f3a4e4daf775e1d17ed975699a57d2a6f3c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Thu, 16 Sep 2021 20:19:09 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Base/DzqController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Base/DzqController.php b/src/Base/DzqController.php index 889df85..673cf64 100644 --- a/src/Base/DzqController.php +++ b/src/Base/DzqController.php @@ -64,7 +64,6 @@ abstract class DzqController implements RequestHandlerInterface $this->user = $request->getAttribute('actor'); $this->c9IbQHXVFFWu($this->user);//添加辅助函数 $this->dzqLogInit(); - //临时处理管理端接口权限 $path = $this->request->getUri()->getPath(); if(stristr($path,'backAdmin') && !stristr($path,'backAdmin/login')){ @@ -133,8 +132,15 @@ abstract class DzqController implements RequestHandlerInterface /* * 接口入参 */ - public function inPut($name, $checkValid = true) + public function inPut($name='', $checkValid = true) { + if(empty($name)){ + if($this->parseBody instanceof \Illuminate\Support\Collection){ + return $this->parseBody->merge($this->queryParams)->all(); + }else{ + return $this->queryParams; + } + } $p = ''; if (isset($this->queryParams[$name])) { $p = $this->queryParams[$name]; -- Gitee From c24d1c4b7734442650bb1a95cb838bb6dcd46aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Sat, 18 Sep 2021 15:13:34 +0800 Subject: [PATCH 08/10] no message --- src/Base/DzqController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Base/DzqController.php b/src/Base/DzqController.php index 673cf64..b26b110 100644 --- a/src/Base/DzqController.php +++ b/src/Base/DzqController.php @@ -47,8 +47,8 @@ abstract class DzqController implements RequestHandlerInterface protected $isDebug = true; - private $queryParams = []; - private $parseBody = []; + public $queryParams = []; + public $parseBody = []; public $providers = []; -- Gitee From 6c34930a1cf49b70b43e17be0eab78691f9e3ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Wed, 22 Sep 2021 12:49:24 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0migrate:plugin=E5=91=BD?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Api/ApiServiceProvider.php | 2 +- src/Common/Utils.php | 67 +++++++++++++++++++++-- src/Database/MigrationServiceProvider.php | 17 +----- src/Database/PluginCommand.php | 58 ++++++++++++++++++++ 4 files changed, 125 insertions(+), 19 deletions(-) create mode 100644 src/Database/PluginCommand.php diff --git a/src/Api/ApiServiceProvider.php b/src/Api/ApiServiceProvider.php index 3dec204..45623f2 100644 --- a/src/Api/ApiServiceProvider.php +++ b/src/Api/ApiServiceProvider.php @@ -127,7 +127,7 @@ class ApiServiceProvider extends ServiceProvider private function setPluginRoutes($route, $reqUri) { - $plugins = Utils::getPluginList(); + $plugins = \Discuz\Common\Utils::getPluginList(); preg_match("/(?<=plugin\/).*?(?=\/api)/", $reqUri, $m); $pluginName = $m[0]; foreach ($plugins as $plugin) { diff --git a/src/Common/Utils.php b/src/Common/Utils.php index 38b374c..1a2db9e 100644 --- a/src/Common/Utils.php +++ b/src/Common/Utils.php @@ -2,7 +2,10 @@ namespace Discuz\Common; +use App\Common\CacheKey; +use App\Common\DzqConst; use App\Common\ResponseCode; +use Discuz\Base\DzqCache; use Discuz\Base\DzqLog; use Illuminate\Http\Request; use Illuminate\Support\Str; @@ -36,7 +39,7 @@ class Utils $request = app('request'); $headers = $request->getHeaders(); $server = $request->getServerParams(); - if(!empty($headers['referer']) && stristr(json_encode($headers['referer']),'servicewechat.com')){ + if (!empty($headers['referer']) && stristr(json_encode($headers['referer']), 'servicewechat.com')) { return PubEnum::MinProgram; } // app('log')->info('get_request_from_for_test_' . json_encode(['headers' => $headers, 'server' => $server], 256)); @@ -141,7 +144,7 @@ class Utils } if ($code != 0) { - app('log')->info('result error:' . $code.' api:'.$request->getUri()->getPath().' msg:'.$msg); + app('log')->info('result error:' . $code . ' api:' . $request->getUri()->getPath() . ' msg:' . $msg); } $ret = [ @@ -155,7 +158,7 @@ class Utils if (strpos($api, 'backAdmin') === 0) { DzqLog::inPut(DzqLog::LOG_ADMIN); DzqLog::outPut($ret, DzqLog::LOG_ADMIN); - } elseif (! empty($dzqLog['openApiLog'])) { + } elseif (!empty($dzqLog['openApiLog'])) { DzqLog::inPut(DzqLog::LOG_API); DzqLog::outPut($ret, DzqLog::LOG_API); } @@ -165,7 +168,63 @@ class Utils header($k . ':' . $v); } header('Content-Type:application/json; charset=utf-8', true, 200); - header('Dzq-CostTime:'.((microtime(true) - DISCUZ_START)*1000).'ms'); + header('Dzq-CostTime:' . ((microtime(true) - DISCUZ_START) * 1000) . 'ms'); exit(json_encode($ret, 256)); } + + public static function getPluginList() + { +// $cacheConfig = DzqCache::get(CacheKey::PLUGIN_LOCAL_CONFIG); +// if ($cacheConfig) return $cacheConfig; + $pluginDir = base_path('plugin'); + $directories = scandir($pluginDir); + $plugins = []; + foreach ($directories as $dirName) { + if ($dirName == '.' || $dirName == '..') continue; + $subPlugins = scandir($pluginDir . '/' . $dirName); + $configName = ''; + $viewName = ''; + $databaseName = ''; + $consoleName = ''; + foreach ($subPlugins as $item) { + if ($dirName == '.' || $dirName == '..') continue; + switch (strtolower($item)) { + case 'config.php': + $configName = $item; + break; + case 'view': + $viewName = $item; + break; + case 'database': + $databaseName = $item; + break; + case 'console': + $consoleName = $item; + break; + } + } + if ($configName == '') { + continue; + } + $appBase = $pluginDir . '/' . $dirName . '/'; + $configPath = $appBase . $configName; + $viewPath = $viewName == '' ? null : $appBase . $viewName . '/'; + $databasePath = $databaseName == '' ? null : $appBase . $databaseName . '/'; + $consolePath = $consoleName == '' ? null : $appBase . $consoleName . '/'; + $config = require($configPath); + if ($config['status'] == DzqConst::BOOL_YES) { + $config['plugin_' . $config['app_id']] = [ + 'directory' => $appBase, + 'view' => $viewPath, + 'database' => $databasePath, + 'console' => $consolePath, + 'config' => $configPath + ]; + } + isset($config['app_id']) && $plugins[$config['app_id']] = $config; + } + DzqCache::set(CacheKey::PLUGIN_LOCAL_CONFIG, $plugins, 5 * 60); + return $plugins; + } + } diff --git a/src/Database/MigrationServiceProvider.php b/src/Database/MigrationServiceProvider.php index 8d2c226..3e421cb 100644 --- a/src/Database/MigrationServiceProvider.php +++ b/src/Database/MigrationServiceProvider.php @@ -44,7 +44,8 @@ class MigrationServiceProvider extends IlluminateMigrationServiceProvider RefreshCommand::class, ResetCommand::class, RollbackCommand::class, - StatusCommand::class + StatusCommand::class, + PluginCommand::class ]; public function register() @@ -60,7 +61,7 @@ class MigrationServiceProvider extends IlluminateMigrationServiceProvider /** * Register the given commands. * - * @param array $commands + * @param array $commands * @return void */ protected function registerCommands(array $commands) @@ -72,18 +73,6 @@ class MigrationServiceProvider extends IlluminateMigrationServiceProvider }); } - /** - * Register the command. - * - * @return void - */ - protected function registerMigrateCommand() - { - $this->app->singleton('command.migrate', function ($app) { - return new MigrateCommand($app['migrator']); - }); - } - protected function registerCreator() { $this->app->singleton('migration.creator', function ($app) { diff --git a/src/Database/PluginCommand.php b/src/Database/PluginCommand.php new file mode 100644 index 0000000..3505be1 --- /dev/null +++ b/src/Database/PluginCommand.php @@ -0,0 +1,58 @@ +input->getOption('name'); + if (empty($name)) throw new \Exception('expected one plugin name,used like [ php disco migrate:plugin --name=test ]'); + $pluginList = Utils::getPluginList(); + + $basePath = base_path().'/'; + foreach ($pluginList as $item) { + if (strtolower($item['name_en']) == strtolower($name)) { + $paths = 'plugin_' . $item['app_id']; + $databasePath = $item[$paths]['database'] . 'migrations'; + $databasePath = str_replace($basePath,'',$databasePath); + if (!file_exists($databasePath)) throw new \Exception($databasePath . ' directory in ' . $item['name_en'] . ' not exist.'); + $this->call('migrate', array_filter(['--path' => $databasePath])); + break; + } + } + } + + protected function getOptions() + { + return [ + ['name', null, InputOption::VALUE_OPTIONAL, 'The plugin app name to use'], + ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'], + ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production'], + ['path', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The path(s) to the migrations files to be executed'], + ['seeder', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder'], + ]; + } +} -- Gitee From deaf3c98165ad4ce8710fde19c7551712b76b69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E7=81=AB=E8=A1=8C=E8=80=85?= Date: Wed, 22 Sep 2021 12:57:10 +0800 Subject: [PATCH 10/10] no message --- src/Common/Utils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common/Utils.php b/src/Common/Utils.php index 1a2db9e..9564a3f 100644 --- a/src/Common/Utils.php +++ b/src/Common/Utils.php @@ -174,8 +174,8 @@ class Utils public static function getPluginList() { -// $cacheConfig = DzqCache::get(CacheKey::PLUGIN_LOCAL_CONFIG); -// if ($cacheConfig) return $cacheConfig; + $cacheConfig = DzqCache::get(CacheKey::PLUGIN_LOCAL_CONFIG); + if ($cacheConfig) return $cacheConfig; $pluginDir = base_path('plugin'); $directories = scandir($pluginDir); $plugins = []; -- Gitee