2017 © Pedro Peláez
 

library zf2-maintenance-mode

ZF2 maintenance mode module

image

mpalourdio/zf2-maintenance-mode

ZF2 maintenance mode module

  • Saturday, February 4, 2017
  • by mpalourdio
  • Repository
  • 1 Watchers
  • 2 Stars
  • 3,048 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

PHP 7.0+ MIT Licensed, (*1)

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)., (*2)

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., (*3)

Requirements

PHP 7.0+, (*4)

Installation

Run the command below to install via Composer, (*5)

composer require mpalourdio/zf2-maintenance-mode

Add "ZfMaintenanceMode" to your modules list in application.config.php, (*6)

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., (*7)

Instead of the message, you can add an html status page by providing the html option parameter., (*8)

Enable maintenance mode

cd path/to/project/root
php public/index.php maintenance enable

Note: clear your cached configuration if needed., (*9)

Disable maintenance mode

cd path/to/project/root
php public/index.php maintenance disable

The Versions