Skip to content

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Nov 29, 2025

  • Resolves: #

Summary

What

  • Register only the commands that are valid for the current global state (installed / uninstalled / maintenance / upgrade-needed).
  • Move early CLI environment validation into Application::checkEnvironmentEssentials() and run OC_Util::checkServer(...) before loading apps.
  • Simplify core/register_command.php with explicit per-state command lists and reduced boilerplate.
  • Explicit command lists for each state in core/register_command.php.
  • Simpler, clearer control flow in Application.php.
  • Miscellaneous robustness/UX improvements in Application.php

Why

  • Fail fast: avoid loading many apps when the PHP/environment is clearly unsuitable.
  • UX: administrators only see commands that actually work in the current server state.
  • Safety: reduces accidental invocations of commands that would be unsafe in the current state.
  • Maintainability: clearer control flow. delegation of details to private functions, and explicit command lists make it easier to reason about code

TODO

  • ...

Checklist

- Smarter command registration based on state
- Streamlined code path

Signed-off-by: Josh <[email protected]>
@joshtrichards joshtrichards added enhancement feature: occ performance 🚀 ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels Nov 29, 2025
@joshtrichards joshtrichards changed the title refactor(console): register commands based on state; simplify control flow refactor(console): register commands by state and simplify CLI command-loading flow Nov 30, 2025
@joshtrichards joshtrichards changed the title refactor(console): register commands by state and simplify CLI command-loading flow refactor(console): register commands by state and simplify CLI command-loading Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement feature: occ performance 🚀 ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants