Recommend this page to a friend! |
Classes of Roni | EZ PHP Maintenance Mode | README.md | Download |
|
DownloadEasy MaintenanceUtility Library to handle site maintenance situation Key Features
Installation/UsageIf you're using Composer to manage dependencies, you can include the following in your composer.json file:
Then, after running
Otherwise, you can simply require the given
Then you can just call Different Adapters to check maintenance modeUse adapter to detect if we need to serve the maintenance page or not. 3 Types of adapter provided. You can also define your own adapter. File AdaptersThis is the default adapter. it checks for a specific file if exist or not. default path is down. For the following implementation
you will be shown maintenance page if there is a file exists named
Env AdaptersUsing this adapter you can watch over existence of an environment variable. The maintenance page will be shown if the environment variable is present with specific value.
Const AdaptersThis is same ad the env adapter. Only difference is it will check for a php constant instead of environment variable.
Custom AdaptersYou can define your own adapter by implementing the Common optionsFollowing options are available to customize the behaviour of the library intervalThis option state the interval in second, the system will check for the site status with this interval. default is 5 second. override_keyYou can configure a key to override the maintenance mode. This is helpful t test your site normally while others will see maintenance page.
To browse the page in maintenance mode, you just need to pass the override key as query parameter like: inverseIf you want to enable maintenance mode when adapter return false, you can set templateYou can provide the built-in template name(simple, game, clock) or path to your own template file. All the options will also be available in your template.
You should
msgIf you are using any of the default template, you can customize the message using this option. Contributing to LibraryIf you find a bug or want to add a feature to EzMaintenance, great! In order to make it easier and quicker for me to verify and merge changes in, it would be amazing if you could follow these few basic steps:
|