307 Star 1.5K Fork 331

GVPThinkPHP / thinkphp

 / 详情

ThinkPHP 5.0.24 是否有办法在程序内调用自定义的命令

待办的
创建于  
2020-06-09 23:32

类比:Laravel 内提供的 **Artisan::call() ** 方法,可以在程序内调用自定义的命令行动作。

如果没有方法,是否可以通过 实例化 自定义的 Class HelloCommand extend Command 。
但是在 think\Command 内有 **public function run() ** 方法,以及强制重载的 ** protected function execute() ** 方法。

有没有办法?

还是只能 **shell_exec('php /path/to/think hello:world --param ' . $param) ** 这样的方法?

评论 (1)

Ragus 创建了任务
Ragus 关联仓库设置为ThinkPHP/thinkphp
展开全部操作日志

想要?简单封装就好了,都一样的 执行原理

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
555003 waysir 1648792515 960725 ragus 1578936838
PHP
1
https://gitee.com/liu21st/thinkphp.git
git@gitee.com:liu21st/thinkphp.git
liu21st
thinkphp
thinkphp

搜索帮助