From c6b8e1af82b9d9e710b4d8828a6c574f1c566889 Mon Sep 17 00:00:00 2001 From: cloud Date: Wed, 13 Apr 2022 06:35:30 +0800 Subject: [PATCH] 0.1 --- bin/Base.php | 16 ++++++++-------- bin/Psr4Autoload.php | 1 - demo/AbstractFactory/Run.php | 14 -------------- demo/Creational/A/Run.php | 16 ++++++++++++++++ mode/Ceshi.php | 11 ----------- 5 files changed, 24 insertions(+), 34 deletions(-) delete mode 100644 demo/AbstractFactory/Run.php create mode 100644 demo/Creational/A/Run.php delete mode 100644 mode/Ceshi.php diff --git a/bin/Base.php b/bin/Base.php index e6013a2..97190be 100644 --- a/bin/Base.php +++ b/bin/Base.php @@ -124,15 +124,15 @@ class Base $dirFiles = scandir($dir); $oldDir = $dir . DIRECTORY_SEPARATOR; foreach ($dirFiles as $file) { - if ($file !== '.' && $file !== '..') { - $newsDir = $oldDir . $file; - if (is_dir($newsDir)) { - $this->scandir($newsDir); - } elseif ($file === 'Run.php') { - // 这样可以屏蔽非入口 - $this->dirFiles[] = $oldDir . 'Run'; - } + if ($file === '.' || $file === '..') continue; + + if (is_dir($newsDir = $oldDir . $file)) { + $this->scandir($newsDir); + } elseif ($file === 'Run.php') { + // 这样可以屏蔽非入口 + $this->dirFiles[] = $oldDir . 'Run'; } + } } diff --git a/bin/Psr4Autoload.php b/bin/Psr4Autoload.php index 73f354d..1e854c4 100644 --- a/bin/Psr4Autoload.php +++ b/bin/Psr4Autoload.php @@ -22,7 +22,6 @@ class Psr4Autoload $this->addNamespace('bin', ROOTDIR . DIRECTORY_SEPARATOR . 'bin', true); $this->addNamespace('demo', ROOTDIR . DIRECTORY_SEPARATOR . 'demo', true); - $this->addNamespace('mode', ROOTDIR . DIRECTORY_SEPARATOR . 'mode', true); } diff --git a/demo/AbstractFactory/Run.php b/demo/AbstractFactory/Run.php deleted file mode 100644 index 2d3e774..0000000 --- a/demo/AbstractFactory/Run.php +++ /dev/null @@ -1,14 +0,0 @@ -