Skip to content

[ticket/17616] Add simple maintenance page without autoloader, sessions, etc.#6933

Open
marc1706 wants to merge 18 commits intophpbb:masterfrom
marc1706:ticket/17616
Open

[ticket/17616] Add simple maintenance page without autoloader, sessions, etc.#6933
marc1706 wants to merge 18 commits intophpbb:masterfrom
marc1706:ticket/17616

Conversation

@marc1706
Copy link
Copy Markdown
Member

@marc1706 marc1706 commented Feb 21, 2026

Replaces #6932

It is possible to test the maintenance page by commenting out the die() in the develop script and navigating to it. This script will remove the lock file again at the end. In order to test the behavior of the maintenance page disabling the normal board, one can also uncomment the unlink to keep the UPDATE_LOCK.php in place.

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17616

@marc1706 marc1706 added this to the 4.0.0-a2 milestone Feb 21, 2026
@marc1706 marc1706 mentioned this pull request Feb 21, 2026
6 tasks
@marc1706
Copy link
Copy Markdown
Member Author

Current look:
Screenshot 2026-02-20 220144

Documentation:
phpbb/documentation#313

@marc1706
Copy link
Copy Markdown
Member Author

@rubencm

That about moving this to styles/all and 'include' it from here?

Usually I'd be all for this but the point of this is to rely on as little as possible files from phpBB. Hence no extra HTML file or using sessions, config, template system, etc.

@Neustradamus
Copy link
Copy Markdown

@marc1706: It will be nice!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a static, lightweight maintenance page intended to be served during updates (via a lock file) without needing Composer autoloading, sessions, etc.

Changes:

  • Adds a new maintenance page template and stylesheet and exports them into a static lock file (store/UPDATE_LOCK.*).
  • Adds a maintenance_generator service to generate the lock file content with localized strings and optional social links.
  • Adds early startup handling to serve the maintenance page (HTTP 503) when the lock file exists.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
phpBB/styles/all/theme/maintenance.css New CSS for the maintenance page layout and links section.
phpBB/styles/all/template/maintenance_page.html New Twig template for the maintenance page (inline CSS + small JS for localization/time).
phpBB/phpbb/update/maintenance_generator.php New generator that renders the template and writes a lock file into store/.
phpBB/language/en/common.php Adds new language keys for maintenance title/message/start time.
phpBB/includes/startup.php Adds early maintenance-mode detection and response handling before autoloading.
phpBB/develop/maintenance_preview.php Dev-only preview script to generate and display the maintenance page.
phpBB/config/default/container/services_updater.yml Registers update.maintenance_generator in DI container.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread phpBB/includes/startup.php
Comment thread phpBB/includes/startup.php
Comment thread phpBB/styles/all/template/maintenance_page.html Outdated
Comment thread phpBB/styles/all/template/maintenance_page.html Outdated
Comment thread phpBB/styles/all/template/maintenance_page.html Outdated
Comment thread phpBB/phpbb/update/maintenance_generator.php
Comment thread phpBB/config/default/container/services_updater.yml
Comment thread phpBB/phpbb/update/maintenance_generator.php
Comment thread phpBB/includes/startup.php
Comment thread phpBB/includes/startup.php
Comment thread phpBB/phpbb/update/maintenance_generator.php
@marc1706 marc1706 requested a review from rubencm April 11, 2026 06:44
Comment thread phpBB/develop/maintenance_preview.php
* @return void
* @throws ExceptionInterface If writing of maintenance lock file fails
*/
public function write_maintenance_lock(array $social_links = []): void
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add also a method to delete the maintenance lock using this service to have all the logic for handling maintenance here

Copy link
Copy Markdown
Member

@rubencm rubencm Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete_maintenance_lock
and a static methods maintenance_lock_exist and read_maintenance_lock to be able to call the methods before initialize DI.

Also move all the references to the lock file here. There is a lot of references to the file

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.

4 participants