iulyanp/maintenance-bundle

This package is abandoned and no longer maintained. The author suggests using the iulyanp/maintenance-bundle package instead.

A simple symfony bundle that helps you set your application in maintenance.

Installs: 56

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

v1.0.0 2016-10-18 18:44 UTC

This package is not auto-updated.

Last update: 2021-07-22 09:35:43 UTC


README

Build Status StyleCI Scrutinizer Code Quality Build Status

MaintenanceBundle

The MaintenanceBundle is a simple bundle that helps you to set your application in maintenance.

Installation

Step 1: Require the bundle with composer

Open your terminal and run one of the following commands to download the bundle into your vendor directory.

  • If you have composer installed globally you can run:
$ composer require iulyanp/maintenance-bundle
  • Else you can go with:
$ php composer.phar require iulyanp/maintenance-bundle

Step 2: Register the bundle in your AppKernel class

Register the bundle in the app/AppKernel.php file of your project:

<?php
/** app/AppKernel.php */

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            
            ...
            
            new Iulyanp\MaintenanceBundle\IulyanpMaintenanceBundle(),
        );
    }
}

Step 3: Import the bundle routes

iulyanp_maintenance:
    resource: "@IulyanpMaintenanceBundle/Resources/config/routing.yml"
    prefix:   /

Step 4: Configure the bundle

In order for the bundle to know when to set your website in maintenance you should configure it.

iulyanp_maintenance:
    enabled:   false
    due_date:  '14-10-2017 00:00:00'
    layout:
        signature: 'iulyanp'
        title: We are in maintenance
        description: Comming back soon...

You should use enabled and due_date configurations to chose when you want your application to be in maintenance and until what date. You activate the maintenance by changing the enabled config to true but your website will be in maintenance only if you set the due date configuration.

The layout parameters are for changing the default title, message and signature from the default layout. You can translate these configurations in the translation files.

Note! Do not forget to activate the translations on Symfony framework.

# config.yml

framework:
    translator:      { fallbacks: ["%locale%"] }
    ...