mpalourdio / zf2-maintenance-mode
ZF2 maintenance mode module
Installs: 8 477
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 5
Open Issues: 1
Requires
- php: >=5.5
- zendframework/zend-console: ~2.3
- zendframework/zend-http: ~2.3
- zendframework/zend-modulemanager: ~2.3
- zendframework/zend-mvc: ~2.3
This package is not auto-updated.
Last update: 2024-12-21 19:05:19 UTC
README
zf2 maintenance mode
This ZF2 "maintenance mode" module allows you to stall your application to maintenance (503 by default) via CLI. It's heavily inspired from the [apigility development mode module] (https://github.com/zfcampus/zf-development-mode).
It mainly short-circuits the module manager during modules initialization and short-circuits the framework bootstrapping to prevent any service to load, like db connections for example.
Requirements
PHP 7.0+
Installation
Run the command below to install via Composer
composer require mpalourdio/zf2-maintenance-mode
Add "ZfMaintenanceMode" to your modules list in application.config.php
Eventually, copy maintenance.config.global.php.dist
to config/autoload/maintenance.config.global.php
to personalize the message and/or the http status code and/or the path of the flag file.
Instead of the message, you can add an html status page by providing the html
option parameter.
Enable maintenance mode
cd path/to/project/root php public/index.php maintenance enable
Note: clear your cached configuration if needed.
Disable maintenance mode
cd path/to/project/root
php public/index.php maintenance disable