mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-05 19:41:43 +08:00
60 lines
1.3 KiB
PHP
60 lines
1.3 KiB
PHP
<?php
|
||
/**
|
||
*
|
||
* @since 2021-02-18
|
||
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||
*/
|
||
|
||
namespace app\util;
|
||
|
||
|
||
class AutoBuild {
|
||
|
||
private $config = [
|
||
'model' => 0, // 是否需要构建模型
|
||
'control' => 1, // 是否需要构建控制器
|
||
'menu' => 1, // 是否需要构建目录
|
||
'route' => 1, // 是否需要构建路由
|
||
'name' => '', // 唯一标识
|
||
'module' => 1, // 构建类型 1:admin;2:api
|
||
'table' => 0, // 是否创建表
|
||
'modelName' => '' // 表名称
|
||
];
|
||
|
||
public function run($config = []) {
|
||
$config = array_merge($this->config, $config);
|
||
dump($config);
|
||
}
|
||
|
||
/**
|
||
* 驼峰命名转下划线命名
|
||
* @param $camelCaps
|
||
* @param string $separator
|
||
* @return string
|
||
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||
*/
|
||
private function unCamelize($camelCaps, $separator = '_'): string {
|
||
return strtolower(preg_replace('/([a-z])([A-Z])/', "$1" . $separator . "$2", $camelCaps));
|
||
}
|
||
|
||
private function buildControl() {
|
||
|
||
}
|
||
|
||
private function buildModel() {
|
||
|
||
}
|
||
|
||
private function createTable() {
|
||
|
||
}
|
||
|
||
private function buildMenu() {
|
||
|
||
}
|
||
|
||
private function buildRoute() {
|
||
|
||
}
|
||
}
|