0.1
This commit is contained in:
parent
f549573d19
commit
c6b8e1af82
16
bin/Base.php
16
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';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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('开始了');
|
||||
}
|
||||
}
|
|
@ -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('这个创建型');
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace mode;
|
||||
|
||||
class Ceshi
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
var_dump('mode ceshi');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue