Skip to content

[3.0] Runs the welcome step's checks when installing from the command line - #9688

Merged
Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/cli-install-runs-welcome-checks
Sep 13, 2026
Merged

Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/cli-install-runs-welcome-checks

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Install::welcome() returns as soon as $_POST['contbutt'] is set. On the web that is how a submitted welcome form moves on, and there the checks have already run on the page the admin just saw.

On the command line it cannot work that way. Maintenance::execute() runs every step in one process, and welcome() otherwise ends in return false, so a CLI install has to pass --contbutt=1 from the start — .docker/install-forum.sh does exactly that. The early return then fires before any check, so the PHP version, 64-bit build, database support, session, mbstring and fileinfo checks, and the file manifest check from #9679, are never looked at on the command line.

On release-3.0, with a manifest in place and one template edited after it was built:

$ php install.php --debug=1                          # no --contbutt
Step 1: Welcome
The following files are either missing or have unexpected content:
 - Themes/default/BoardIndex.template.php

$ php install.php --contbutt=1 --db_type=MySQL …     # how every CLI install is run
Step 2: Writable check
…
Step 3: Database Settings
Step 4: Forum Settings
Step 5: Database Population
Creating "smf_admin_info_files"... done.

With this change the early return applies only outside the CLI, and on the command line welcome() runs its checks and returns whether they passed — the same shape as Upgrade::welcomeLogin(), which returns true under the CLI once its own checks are done.

Keeping install-forum.sh working. The Docker entrypoint builds a manifest from the checkout when there is none, and nothing rebuilds it afterwards: reset.sh restarts the container, but the entrypoint skips the build whenever a manifest exists. Once CLI installs check files, a manifest built before a developer's last edit fails every install. So install-forum.sh removes a manifest that is not part of HEAD before resetting, and unstages it first if it was staged, since the entrypoint on release-3.0 stages it (#9687). The restarted entrypoint then builds a fresh one, or none on a dirty working tree, which a development version's installer accepts. A manifest committed at a release tag is left alone.

Verified on an isolated Docker stack built from this branch:

T1  CLI install, template edited, --contbutt=1
    Step 1: Welcome
    Some required files are either missing or have unexpected content.
    exit=1, never reached step 2

T2  web installer, unchanged
    GET  install.php     h2 "Welcome", Continue offered, no error       12.1s (the manifest check)
    POST contbutt=1      h2 "Database Settings", no error               0.5s  (early return, as before)

T3  .docker/install-forum.sh --engine mysql --force, clean tree
    installed SMF 3.0 Alpha 5-dev, exit=0
    afterwards the entrypoint rebuilt the manifest and staged it:  A  Sources/Maintenance/manifest.php

T4  the same, after editing a tracked template, with that stale staged manifest
    tree before:  A  Sources/Maintenance/manifest.php   M Themes/default/BoardIndex.template.php
    installed SMF 3.0 Alpha 5-dev, exit=0
    manifest after: removed, unstaged; tree clean once the edit is reverted

    Without the HEAD check — testing "untracked" with git ls-files, which counts
    a staged file as tracked — the same run stopped with:
    error: Some required files are either missing or have unexpected content.

Not reachable from the PHPUnit suite: this is the installer's command-line flow, and running it from the integration suite would replace the very forum that suite runs against.

Issues References (Fixes|Related|Closes)

  1. Related: [3.0] Improves file integrity checks in installer and upgrader #9679
  2. Related: [3.0] Only commits the manifest when update_manifest.php is asked to #9687 — the entrypoint stages the manifest this removes from the index
  3. Related: [3.0] Silences the manifest build in the Docker entrypoint without backgrounding it #9686 — the entrypoint line that builds the manifest

🤖 Generated with Claude Code

Install::welcome() returns as soon as contbutt is set, which is how a
submitted welcome form moves on. From the command line contbutt has to be
passed with every run, so the PHP version, database, session and manifest
checks never ran there, and a CLI install went ahead on a checkout with
missing or altered files.

On the command line the checks now always run, and decide whether the
install continues.

install-forum.sh removes a manifest that is not part of HEAD before
resetting, unstaging it first if it was staged, so the entrypoint builds a
fresh one from the current checkout rather than the installer checking
edited files against an old one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@Sesquipedalian
Sesquipedalian merged commit e35ee87 into SimpleMachines:release-3.0 Sep 13, 2026
9 checks passed
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants