mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
修正命令行文件生成
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace think\console\command;
|
namespace think\console\command;
|
||||||
|
|
||||||
|
use think\App;
|
||||||
use think\Config;
|
use think\Config;
|
||||||
use think\console\Command;
|
use think\console\Command;
|
||||||
use think\console\Input;
|
use think\console\Input;
|
||||||
@@ -64,21 +65,21 @@ abstract class Make extends Command
|
|||||||
return str_replace(['{%className%}', '{%namespace%}', '{%app_namespace%}'], [
|
return str_replace(['{%className%}', '{%namespace%}', '{%app_namespace%}'], [
|
||||||
$class,
|
$class,
|
||||||
$namespace,
|
$namespace,
|
||||||
Config::get('app_namespace')
|
App::$namespace,
|
||||||
], $stub);
|
], $stub);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getPathName($name)
|
protected function getPathName($name)
|
||||||
{
|
{
|
||||||
$name = str_replace(Config::get('app_namespace') . '\\', '', $name);
|
$name = str_replace(App::$namespace . '\\', '', $name);
|
||||||
|
|
||||||
return APP_PATH . str_replace('\\', '/', $name) . '.php';
|
return APP_PATH . str_replace('\\', '/', $name) . '.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getClassName($name)
|
protected function getClassName($name)
|
||||||
{
|
{
|
||||||
$appNamespace = Config::get('app_namespace');
|
$appNamespace = App::$namespace;
|
||||||
|
|
||||||
if (strpos($name, $appNamespace . '\\') === 0) {
|
if (strpos($name, $appNamespace . '\\') === 0) {
|
||||||
return $name;
|
return $name;
|
||||||
|
|||||||
Reference in New Issue
Block a user