kmadejski / ezplatform-maintenance-mode
Maintenance mode bundle for Ibexa DXP v2.5+
Installs: 6 919
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 0
Type:ezplatform-bundle
Requires
- php: ^7.3
- ezsystems/ezplatform-kernel: ^1.2
- symfony/config: ^5.1
- symfony/dependency-injection: ^5.1
- symfony/event-dispatcher: ^5.1
- symfony/http-foundation: ^5.1
- symfony/http-kernel: ^5.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.15.0
- phpunit/phpunit: ^7.2.5
This package is auto-updated.
Last update: 2024-11-08 18:31:22 UTC
README
This Ibexa DXP v3.x+ bundle provides a simple way to switch the whole site or selected SiteAccess to maintenance mode.
In this mode the site (or particular SiteAccess) will not be available for the end-users. Selected template is displayed instead.
Installation
- Install the bundle:
composer require kmadejski/ezplatform-maintenance-mode
- If you do not use Symfony Flex, you have to enable the bundle manually in your
config/bundles.php
file:
... EzSystems\EzPlatformMaintenanceModeBundle\EzSystemsEzPlatformMaintenanceModeBundle::class => ['all' => true]
- Clear application cache:
php bin/console cache:clear --env=prod
Configuration
Bundles configuratiton is SiteAccess-aware, therefore all options are configurable in ezplatform.yml
under default
SiteAccess configuration key (if you want to switch the whole site into maintenance mode) or under selected SiteAccess:
ezplatform: system: default: maintenance_mode: enabled: true
By default 503
HTTP response code is returned and a default template @EzSystemsEzPlatformMaintenanceMode/maintenance.html.twig
is rendered. No IP addresses are allowed to visit the page. To modify this behaviour you can add an additional configuration as following example presents:
ezplatformgs: system: default: maintenance_mode: enabled: true allowed_ips: ['::1', '10.0.0.1', '192.168.0.0/16'] response_code: 404 template: '@Acme/custom_maintenance.html.twig'