Download the PHP package juliangut/zf-maintenance without Composer
On this page you can find all versions of the php package juliangut/zf-maintenance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download juliangut/zf-maintenance
More information about juliangut/zf-maintenance
Files in juliangut/zf-maintenance
Package zf-maintenance
Short Description Zend Framework maintenance module
License BSD-3-Clause
Homepage https://github.com/juliangut/zf-maintenance
Informations about the package zf-maintenance
Juliangut Zend Framework Maintenance Module
Maintenance module for Zend Framework 2.
Installation
- Best way to install is using Composer:
or download it directly from github and place it in your application's module/
directory.
-
Add
Jgut\Zf\Maintenance
module to the module section of yourconfig/application.config.php
-
Copy
config\zf-maintenance.global.php.dist
to yourconfig
directory and rename itzf-maintenance.global.php
- Install zend-developer-tools (optional)
Configuration
Configuration example can be found in config\zf-maintenance.global.php.dist
Strategy
Custom strategy to handle maintenance mode.
To create your own just extend Jgut\Zf\Maintenance\View\MaintenanceStrategy
Template
Template file for maintenance strategy
Block
By default maintenance mode prevents application from continuing execution by throwing Zend\Mvc\MvcEvent::EVENT_DISPATCH_ERROR
handled by Jgut\Zf\Maintenance\View\MaintenanceStrategy
If you don't want maintenance mode to stop execution and show maintenance page then set block to false.
This can be used in case you are performing maintenance tasks that don't need the application to be shut down, like ddbb backup, ...
In this case it is usefull to use maintenanceMessage
view helper to show maintenance information
Providers
Maintenance mode providers serve different means to activate maintenance mode
Providers are checked in the order they appear in providers array, when one provider is active the rest of providers are not checked
Common attributes
All maintenance providers have a message
attribute used in maintenance strategy page
ConfigProvider
Manual provider, set maintenance mode just by setting active
attribute
EnvironmentProvider
Environment variable check provider, checks an environment variable to set maintenance mode
FileProvider
File provider, verifies the existance of a file to set maintenance mode
Scheduled Providers
Any provider implementing Jgut\Zf\Maintenance\Provider\ScheduledProviderInterface
will be used to determine future maintenance situations and used on scheduledMaintenance
view helper as well as in zend-developer-tools
ConfigScheduledProvider
Manually scheduled maintenance time frame
Maintenance mode will be set on during the time span provided by start
and end
attributes (DateTime valid string or object).
If only start
provided maintenance mode won't stop once started. If only end
provided maintenance mode will be on from this moment and until end time
CrontabProvider
Scheduled maintenance based on CRON expression syntax
Maintenance mode will be set on during the time span provided by CRON expression and interval
attribute (valid DateInterval specification string).
Uses Michael Dowling (mtdowling) cron-expression
Exclusions
Conditions to bypass maintenance mode
Exclusions are checked the same way as providers are, in the order they are located in exclusions array, when one exclusion is active (isExcluded) the rest of exclusions are not checked
IpExclusion
Excludes IPs from maintenance mode
RuteExclusion
Excludes routes from maintenance mode
View helpers
MaintenanceMessage
maintenanceMessage
will return the message of current active maintenance provider or empty string if not in maintenance mode
Allows you to show maintenance message when maintenance is in non blocking state or for those users for who exclusions apply
This helper would normally be used on a general template as application header or footer as an informative area. Mind that if in maintenance blocking mode all requests not bound by exclusions will be redirected to maintenance page
ScheduledMaintenance
scheduledMaintenance
will return an array with the next scheduled maintenance time period
ZendDeveloperTools integration
A collector jgut-zf-maintenance-collector
is present for
ZendDeveloperTools showing current maintenance status and future scheduled maintenance period times
Contributing
Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before
See file CONTRIBUTING.md
License
Release under BSD-3-Clause License.
See file LICENSE included with the source code for a copy of the license terms
All versions of zf-maintenance with dependencies
zendframework/zendframework Version ~2.3
mtdowling/cron-expression Version ~1.0