重新修改主业务逻辑的命名规则

This commit is contained in:
2023-09-23 17:48:36 +08:00
parent bee15dfea6
commit 44edefb37b
82 changed files with 264 additions and 118 deletions

23
dev.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
// 递归处理多级目录extend\base\admin将所有以 Class.php 结尾的文件重命名为 Base.php
$dir = './extend/base/admin';
// 递归获取所有的文件
function scan_dir($dir)
{
$files = array_diff(scandir($dir), ['..', '.']);
foreach ($files as $file) {
if (is_dir($dir . DIRECTORY_SEPARATOR . $file)) {
scan_dir($dir . DIRECTORY_SEPARATOR . $file);
} else {
if (str_ends_with($file, 'Class.php')) {
$file_path = $dir . DIRECTORY_SEPARATOR . $file;
$new_path = str_replace('Class.php', 'Base.php', $file_path);
rename($file_path, $new_path);
}
}
}
}
scan_dir($dir);