From 0eafee8a69b4d035465c11775d89a538452f915d Mon Sep 17 00:00:00 2001 From: Chino Chang Date: Tue, 5 Apr 2016 14:59:52 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Console=20=E5=A2=9E=E5=8A=A0=E6=B8=85?= =?UTF-8?q?=E7=90=86=E7=BC=93=E5=AD=98=E5=8A=9F=E8=83=BD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Console.php | 3 +- library/think/console/command/cache/Clear.php | 62 ------------------- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 library/think/console/command/cache/Clear.php diff --git a/library/think/Console.php b/library/think/Console.php index 93d17c52..24b85134 100644 --- a/library/think/Console.php +++ b/library/think/Console.php @@ -49,8 +49,7 @@ class Console "think\\console\\command\\Lists", "think\\console\\command\\Build", "think\\console\\command\\make\\Controller", - "think\\console\\command\\make\\Model", - "think\\console\\command\\cache\\Clear" + "think\\console\\command\\make\\Model" ]; public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') diff --git a/library/think/console/command/cache/Clear.php b/library/think/console/command/cache/Clear.php deleted file mode 100644 index 4babaa55..00000000 --- a/library/think/console/command/cache/Clear.php +++ /dev/null @@ -1,62 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command\cache; - -use think\console\command\Command; -use think\console\Input; -use think\console\input\Option as InputOption; -use think\console\Output; - -class Clear extends Command -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('cache:clear') - ->setDescription('Clear Application Runtime'); - } - - protected function execute(Input $input, Output $output) - { - if (APP_DEBUG) { - $output->writeln("Open debug, do not need clear."); - return; - } - $templateDir = RUNTIME_PATH . '\temp'; - if (!file_exists($templateDir)) { - $output->writeln("Runtime does not exist."); - return; - } - $this->rmdirs($templateDir); - $output->writeln("Clear done!"); - } - - protected function rmdirs($dir) - { - $dir_arr = scandir($dir); - foreach($dir_arr as $key=>$val){ - if($val == '.' || $val == '..'){} - else { - if(is_dir($dir.'/'.$val)) - { - if(@rmdir($dir.'/'.$val) == 'true'){} - else - rmdirs($dir.'/'.$val); - } - else - unlink($dir.'/'.$val); - } - } - } -}