`please` cannot run app commands from app/Console/Commands on Laravel 13.36+
维护者通常 1 天内回复
评估
调研方向
Start by reading src/Console/Please/Kernel.php and compare its getArtisan() command resolution with Laravel 13.36's kernel behavior described in the issue. Check the existing command tests or add a regression case for a command discovered in app/Console/Commands; done means php please app:example works and Statamic commands still run. Pull request #15809 is already open against this issue.
由索引模型根据 Issue 内容生成。
描述
Bug description
Since Laravel 13.36.0, php please no longer finds commands that Laravel discovers in app/Console/Commands. php artisan runs them normally, but php please fails:
$ php artisan static:warm-links --help # works
$ php please static:warm-links --help
ERROR Command "static:warm-links" is not defined.
The commands are also missing from php please list. Statamic's own commands (php please static:clear and so on) still work.
Cause
laravel/framework#61931 ("Keep the console kernel's own commands on the kernel instance", released in v13.36.0) changed Illuminate\Foundation\Console\Kernel:
load()andcommand()no longer register commands throughArtisan::starting(...). They add them to a new property,$kernelCommands.getArtisan()now resolves both lists:->resolveCommands([...$this->kernelCommands, ...$this->commands])
Statamic\Console\Please\Kernel::getArtisan() overrides this method and still resolves only $this->commands:
(new Please($this->app, $this->events, Statamic::version()))
->resolveCommands($this->commands)
So under please, the commands in $kernelCommands are never registered. Closure commands defined with Artisan::command() in routes/console.php go through Kernel::command() too, so they are probably affected as well (not tested).
Suggested fix
In src/Console/Please/Kernel.php:
->resolveCommands([...($this->kernelCommands ?? []), ...$this->commands])
The ?? [] keeps it working on Laravel versions before 13.36, where the property does not exist. Tested locally: the app command runs under please again, and Statamic's commands still work.
How to reproduce
- Statamic 6.x on Laravel 13.36.0 or newer.
php artisan make:command Example(signature e.g.app:example).php artisan app:exampleworks.php please app:examplefails withCommand "app:example" is not defined.- With Laravel 13.35 or older, step 4 works.
Logs
ERROR Command "app:example" is not defined.
Environment
Statamic 6.40.0 Pro
Laravel 13.40.0
PHP 8.5.12
Installation
Existing Laravel app, installed Statamic.
Additional details
Found when a deploy script that runs php please <app command> broke after an upgrade that also moved Laravel from 13.29 to 13.40. Workaround: call app commands with php artisan.
- 主要语言
- PHP
- 星标
- 4.9k
- 派生
- 647
- 平均合并
- 21 小时 3 分钟
- 30 天内合并 PR
- 128
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
statamic/cms 的其他 Issue
-
Passing `null` to `bool_string` modifier returns nothing instead of `false`可能已有人在做 @shadetheory 于 4 天前认领。 未关闭modifiers
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
accessibility
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
antlers
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
`GlobalRuntimeState::$interpolatedVariables` is never reset, so long-running Antlers renders slow down without bound可能已有人在做 @lazerg 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
维护者通常 1 天内回复
-
Command palette doesn’t index non published items可能已有人在做 @lazerg 于 1 天前认领。 未关闭search
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/blocks-engine#5003 ·
维护者通常 1 天内回复
-
from-cloud mythic tracked
难度 1/5 1 小时以内 新手友好度 86/100
MythicalLTD/FeatherPanel#459 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: PostgreSQL backend: Queue.remove() / Job.remove() never emit the QueueEvents "removed" event可能已有人在做 @1AbdullahButt 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
taskforcesh/bullmq#5085 ·
维护者通常 1 天内回复
-
area:mesi area:php-extension good first issue priority:low type:chore
难度 2/5 1-3 小时 新手友好度 85/100
crazy-goat/go-mesi#652 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
shukiv/jabali-panel#2423 ·
维护者通常 1 天内回复