feat: 同步下新环境

This commit is contained in:
笔记本里的永平
2025-07-07 11:31:25 +08:00
parent 3d1050db3d
commit 86c261ba70
196 changed files with 13146 additions and 29319 deletions

View File

@@ -11,16 +11,16 @@
namespace think\console\command;
use think\App;
use think\Config;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\Output;
use think\facade\App;
use think\facade\Config;
use think\facade\Env;
abstract class Make extends Command
{
protected $type;
abstract protected function getStub();
@@ -45,7 +45,7 @@ abstract class Make extends Command
}
if (!is_dir(dirname($pathname))) {
mkdir(dirname($pathname), 0755, true);
mkdir(strtolower(dirname($pathname)), 0755, true);
}
file_put_contents($pathname, $this->buildClass($classname));
@@ -62,26 +62,26 @@ abstract class Make extends Command
$class = str_replace($namespace . '\\', '', $name);
return str_replace(['{%className%}', '{%actionSuffix%}', '{%namespace%}', '{%app_namespace%}'], [
return str_replace(['{%className%}', '{%namespace%}', '{%app_namespace%}'], [
$class,
Config::get('action_suffix'),
$namespace,
App::getNamespace(),
App::$namespace,
], $stub);
}
protected function getPathName($name)
{
$name = str_replace(App::getNamespace() . '\\', '', $name);
$name = str_replace(App::$namespace . '\\', '', $name);
return Env::get('app_path') . ltrim(str_replace('\\', '/', $name), '/') . '.php';
return APP_PATH . str_replace('\\', '/', $name) . '.php';
}
protected function getClassName($name)
{
$appNamespace = App::getNamespace();
$appNamespace = App::$namespace;
if (strpos($name, $appNamespace . '\\') !== false) {
if (strpos($name, $appNamespace . '\\') === 0) {
return $name;
}