`please` cannot run app commands from app/Console/Commands on Laravel 13.36+
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 4.9k
- Fork
- 647
- Merge trung bình
- 21 giờ 3 phút
- Pull request đã merge (30 ngày)
- 128
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của statamic/cms
-
Passing `null` to `bool_string` modifier returns nothing instead of `false`Có thể đã có người làm @shadetheory đã nhận 4 ngày trước. Đang mởmodifiers
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
statamic/cms#15748 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
antlers
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`GlobalRuntimeState::$interpolatedVariables` is never reset, so long-running Antlers renders slow down without boundCó thể đã có người làm @lazerg đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Command palette doesn’t index non published itemsCó thể đã có người làm @lazerg đã nhận 1 ngày trước. Đang mởsearch
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Captured slideshow pass overwrites the route path, aborting compose with a rebind() TypeErrorĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Automattic/blocks-engine#5003 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
from-cloud mythic tracked
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
MythicalLTD/FeatherPanel#459 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: PostgreSQL backend: Queue.remove() / Job.remove() never emit the QueueEvents "removed" eventCó thể đã có người làm @1AbdullahButt đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
taskforcesh/bullmq#5085 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:mesi area:php-extension good first issue priority:low type:chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
crazy-goat/go-mesi#652 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
shukiv/jabali-panel#2423 ·
Maintainer thường phản hồi trong vòng 1 ngày