Skip to content

Symfony Bundle to place your Symfony website in maintenance mode

Notifications You must be signed in to change notification settings

artgris/MaintenanceBundle

Folders and files

NameName
Last commit message
Last commit date
Mar 6, 2024
Jan 2, 2022
Oct 15, 2018
Nov 18, 2016
Nov 18, 2016
Oct 15, 2018
Oct 15, 2018
Nov 17, 2016
Jul 20, 2021
Dec 12, 2023
Nov 18, 2016

Repository files navigation

MaintenanceBundle

Symfony Bundle to place your Symfony website in maintenance mode - Default Maintenance Page

Installation

1) Download

composer require artgris/maintenance-bundle

2) Configure the Bundle

Adds following configurations

to config/packages/artgris_maintenance.yaml :

artgris_maintenance:
    enable: true                 # Enable|Disable maintenance - default: false
    ips: ["127.0.0.1","::1",...] # IPs allow (prod) - default: []
    response: 503                # Maintenance Page HTTP Status Code - default: 503

3) Override maintenance.html.twig (optional)

in templates/bundles/ArtgrisMaintenanceBundle/maintenance.html.twig

ex:

{% extends "@!ArtgrisMaintenance/maintenance.html.twig" %}

{% block content %}
    <h1>Site en cours de maintenance</h1>
    <h2>Nous reviendrons bientôt. Désolé pour le dérangement.</h2>
{% endblock %}

Usage

The dev environment was not affected by maintenance.

  • Enable|Disable maintenance : enable: true|false
  • Add authorized IPs to prod : ips: ["127.0.0.1","::1",...]
  • Maintenance Page HTTP Status Code : response: 503

Don't forget to clear the prod cache :

php bin/console cache:clear