Skip to content

Fix bin/cake on CakePHP 5 - #364

Merged
jeanbez merged 1 commit into
IO500:mainfrom
jeanbez:fix-bin-cake-cakephp5
Oct 14, 2026
Merged

jeanbez merged 1 commit into
IO500:mainfrom
jeanbez:fix-bin-cake-cakephp5

Conversation

@jeanbez

@jeanbez jeanbez commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #363. After the upgrade, every bin/cake command (including bin/cake cache clear_all) failed on the server with:

MissingRouteException: A route matching `array ('controller' => 'pages', 'action' => 'display', 0 => 'about', ...)` could not be found.

That message hid the real error:

  • src/Command/ConsoleCommand.php, the psysh console command from the CakePHP 4 app skeleton, extends Cake\Console\Command, which CakePHP 5 removed. Every bin/cake call loads it and fails. The CakePHP 5 skeleton no longer ships it, so this PR deletes it.
  • config/app.php forced WebExceptionRenderer, so command-line errors were rendered as an HTML error page. That page now uses the default layout, whose links need the routes, which aren't loaded on the command line. With the setting removed, CakePHP picks ConsoleExceptionRenderer on the command line and the web renderer on the web, as before.

Testing

  • bin/cake cache clear_all and bin/cake schema_cache clear complete.
  • Web error pages still render (/submissions/view/abc returns 404 with the error page).
  • Tests (46) and composer cs-check pass.

Remove the old psysh console command, which extends a class CakePHP 5
no longer has, and stop forcing the web exception renderer so command
line errors are reported instead of failing on route generation.
@jeanbez
jeanbez requested a review from a team as a code owner October 13, 2026 03:36
@jeanbez
jeanbez merged commit e91f39a into IO500:main Oct 14, 2026
2 checks passed
@jeanbez
jeanbez deleted the fix-bin-cake-cakephp5 branch October 14, 2026 13:20
@jeanbez jeanbez added this to the SC26 milestone Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants