Problem/Motivation

Part of #3582246: [meta] CLI in Core community initiative. Referenced from the CLI in Core Initiative spreadsheet.

Port 2 of 3 commands from Drush. I decided to combine maint:get and maint:status. maint:status now does both duties, and the command help explains how to get the status code using `|| true` if you need it for scripting.

Remaining tasks

None

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

None

AI-Assisted: Yes

Issue fork drupal-3627514

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

moshe weitzman created an issue. See original summary.

moshe weitzman’s picture

Issue summary: View changes
moshe weitzman’s picture

Title: Add maintenance CLI commnds » Add maintenance mode CLI commnds

moshe weitzman’s picture

Issue summary: View changes
moshe weitzman’s picture

Assigned: moshe weitzman » Unassigned
vannergard’s picture

Tested this on a local fresh install of 12.0 and on an established site on 11.4.10. This is the first Need review ticket I took a close look at so I hope I am not doing anything the wrong way here.

The command works for setting and unsetting maintenance and the status combines the drush command for get and status.

The old drush get command did not give an error when Maintenance mode enabled though, and this might be something that I could see some automation tools or such need to be able to need so it is possible there is a reason to not limit to status and get.

Also the output when no value is set on 12.0 is a bit confusing, as

[0] 1
[1] 0

is not super clear if selecting 0 will enable or selecitng 1 will enable.
It turns out selecting 1 here enables so possibly this could be clearer or is there a reason to have the output like this?

Keeping it as Need Review (both because of my questions and because I am not sure this is enugh)