Giter VIP home page Giter VIP logo

maintenance-bundle's Introduction

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%"] }
    ...

maintenance-bundle's People

Contributors

iulyanp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.