From 129dadbc4b4a73dbeb476aaff08701be84699fb3 Mon Sep 17 00:00:00 2001 From: toogee Date: Fri, 22 May 2020 12:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=A1=B5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/res/mods/index.js | 2 +- vendor/psr/log/Psr/Log/Test/DummyTest.php | 18 +++++ .../think-multi-app/src/command/Clear.php | 66 +++++++++++++++++++ view/taoler/index/index/search.html | 57 ++++------------ view/taoler/index/public/index-topforum.html | 2 +- 5 files changed, 98 insertions(+), 47 deletions(-) create mode 100644 vendor/psr/log/Psr/Log/Test/DummyTest.php create mode 100644 vendor/topthink/think-multi-app/src/command/Clear.php diff --git a/public/static/res/mods/index.js b/public/static/res/mods/index.js index 4b97638..60e2ddc 100644 --- a/public/static/res/mods/index.js +++ b/public/static/res/mods/index.js @@ -672,7 +672,7 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util'], function( if(elemReply[0]){ - fly.json(replyurl, { + fly.json(replyUrl, { limit: 20 }, function(res){ var html = laytpl(tplReply).render(res); diff --git a/vendor/psr/log/Psr/Log/Test/DummyTest.php b/vendor/psr/log/Psr/Log/Test/DummyTest.php new file mode 100644 index 0000000..9638c11 --- /dev/null +++ b/vendor/psr/log/Psr/Log/Test/DummyTest.php @@ -0,0 +1,18 @@ + +// +---------------------------------------------------------------------- +namespace think\app\command; + +use think\console\Command; +use think\console\Input; +use think\console\input\Argument; +use think\console\input\Option; +use think\console\Output; + +class Clear extends Command +{ + protected function configure() + { + // 指令配置 + $this->setName('clear') + ->addArgument('app', Argument::OPTIONAL, 'app name .') + ->addOption('cache', 'c', Option::VALUE_NONE, 'clear cache file') + ->addOption('log', 'l', Option::VALUE_NONE, 'clear log file') + ->addOption('dir', 'r', Option::VALUE_NONE, 'clear empty dir') + ->setDescription('Clear runtime file'); + } + + protected function execute(Input $input, Output $output) + { + $app = $input->getArgument('app') ?: ''; + $runtimePath = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($app ? $app . DIRECTORY_SEPARATOR : ''); + + if ($input->getOption('cache')) { + $path = $runtimePath . 'cache'; + } elseif ($input->getOption('log')) { + $path = $runtimePath . 'log'; + } else { + $path = $runtimePath; + } + + $rmdir = $input->getOption('dir') ? true : false; + $this->clear(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $rmdir); + + $output->writeln("Clear Successed"); + } + + protected function clear(string $path, bool $rmdir): void + { + $files = is_dir($path) ? scandir($path) : []; + + foreach ($files as $file) { + if ('.' != $file && '..' != $file && is_dir($path . $file)) { + array_map('unlink', glob($path . $file . DIRECTORY_SEPARATOR . '*.*')); + if ($rmdir) { + rmdir($path . $file); + } + } elseif ('.gitignore' != $file && is_file($path . $file)) { + unlink($path . $file); + } + } + } +} diff --git a/view/taoler/index/index/search.html b/view/taoler/index/index/search.html index d54be81..3a2ec64 100644 --- a/view/taoler/index/index/search.html +++ b/view/taoler/index/index/search.html @@ -61,53 +61,20 @@ TP5学习制作:Tao.2019
- -
-

温馨通道

- -
- - -
-

回贴周榜

-
- -
+ +
+

温馨通道

+ {include file="public/index-static" /}
+
本周热议
- {volist name="artHot" id="vo"} + {volist name="artHot" id="vo" empty="还没有帖子"}
{$vo.title} - 16 + {$vo.comments_count}
{/volist} - - -
@@ -129,13 +96,13 @@ TP5学习制作:Tao.2019 {block name="script"}