This commit is contained in:
cloud 2022-04-13 06:35:30 +08:00
parent f549573d19
commit c6b8e1af82
5 changed files with 24 additions and 34 deletions

View File

@ -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';
}
}
}

View File

@ -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);
}

View File

@ -1,14 +0,0 @@
<?php
namespace demo\AbstractFactory;
class Run extends \bin\Design
{
public string $designName = "抽象工厂模式";
public string $designRefUrl = "https://laravelacademy.org/post/2471";
public function main()
{
var_dump('开始了');
}
}

16
demo/Creational/A/Run.php Normal file
View File

@ -0,0 +1,16 @@
<?php
namespace demo\Creational\A;
use bin\Design;
class Run extends Design
{
public string $designName = "创建型";
public string $designRefUrl = '';
public function main()
{
var_dump('这个创建型');
}
}

View File

@ -1,11 +0,0 @@
<?php
namespace mode;
class Ceshi
{
public function __construct()
{
var_dump('mode ceshi');
}
}