2017 © Pedro Peláez
 

symfony-bundle maintenance-bundle

image

carteni/maintenance-bundle

  • Thursday, June 15, 2017
  • by carteni
  • Repository
  • 0 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

, (*1)

Show your site in maintenance mode. Allow to see the site under maintenance to a list of given IPs., (*2)

SensioLabsInsight, (*3)

Installation

  1. Download the Bundle.
$ composer require carteni/maintenance-bundle
  1. Enable the Bundle in AppKernel.
public function registerBundles()
    {
        $bundles = [
            new \Mes\Misc\MaintenanceBundle\MesMaintenanceBundle(),
        ];
    }
  1. Configure the Bundle.
mes_maintenance:
    enabled: true
    ips_allowed: [10.10.10.0, 10.10.10.1, 10.10.10.2]
    controller: your_custom_controller:controllerAction or leave blank: controller ~.

If you prefer xml:, (*4)


<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:mes-maintenance="http://multimediaexperiencestudio.it/schema/dic/maintenance"
           xsi:schemaLocation="http://multimediaexperiencestudio.it/schema/dic/maintenance
           http://multimediaexperiencestudio.it/schema/dic/maintenance/maintenance-1.0.xsd">

    <mes-maintenance:config enabled="true">
        <mes-maintenance:ip_allowed>10.10.10.0</mes-maintenance:ip_allowed>
        <mes-maintenance:ip_allowed>10.10.10.1</mes-maintenance:ip_allowed>
        <mes-maintenance:ip_allowed>10.10.10.2</mes-maintenance:ip_allowed>
    </mes-maintenance:config>

</container>

The maintenance template can be overridden in app/Resources/MesMaintenanceBundle/views/index.html.twig, (*5)

# app/Resources/MesMaintenanceBundle/views/index.html.twig
{% extends '::base.html.twig' %}

{% block body %}


Custom Template

{% include '@MesMaintenance/maintenance.html.twig' %} {% endblock %}

You can also override the maintenance.html.twig template in app/Resources/MesMaintenanceBundle/views/maintenance.html.twig, (*6)

Unit tests and check code style

$ make
$ make test
$ make cs

License

This bundle is under the MIT license. See the complete license in the bundle, (*7)

Reporting an issue

Issues are tracked in the [Github issue tracker][1]., (*8)

Enjoy!

♥ ☕ m|e|s

The Versions

15/06 2017

1.x-dev

1.9999999.9999999.9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Francesco Cartenì

15/06 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Francesco Cartenì

15/06 2017

v1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Francesco Cartenì