dev-master
9999999-dev http://github.com/awebdeveloper/cakephp-maintenance-modeCakePHP Maintenance Mode
MIT
The Requires
maintenance cakephp dispatcher
CakePHP Maintenance Mode
CakePHP Maintenance Mode is to put your website in maintenance mode while you do your upgrade. Most ppl would add a static file on the server and route all request to it during maintenance. The file is shown to everybody including you unless a rewrite rule or expressions is added to exclude yourself which would complicate the matter., (*1)
This filter file would tell CakePHP to put all requests to maintenance mode i.e show a msg but would allow requests from your IPs to be processed normally., (*2)
CakePHP 2.*, (*3)
[Using Composer], (*4)
View on Packagist, and copy
the JSON snippet for the latest version into your project's composer.json
. Eg, v. 1.2.0 would look like this:, (*5)
{ "require": { "awebdeveloper/cakephp-maintenance-mode": "1.2.0" } }
Because this plugin has the type cakephp-plugin
set in it's own composer.json
, composer knows to install it inside your /Plugin
directory, rather than in the usual vendor directory.
It is recommended that you add /Plugin/MaintenanceMode
to your .gitignore file. (Why? Read this.), (*6)
[Manual], (*7)
app/Plugin
MaintenanceMode
[GIT Submodule], (*8)
In your app directory type:, (*9)
git submodule add -b master git://github.com/awebdeveloper/cakephp-maintenance-mode.git Plugin/MaintenanceMode git submodule init git submodule update
[GIT Clone], (*10)
In your Plugin
directory type:, (*11)
git clone -b master git://github.com/awebdeveloper/cakephp-maintenance-mode.git MaintenanceMode
In your Bootstrap.php add, (*12)
Configure::write('MaintenanceMode', array( 'enabled' => true, 'view' => array( 'layout' => '', 'template' => 'MaintenanceMode/index' ), 'ip_filters' => array('127.0.*.*') ));
Also in the same file find the below code and add this line, (*13)
Configure::write('Dispatcher.filters', array( 'AssetDispatcher', 'CacheDispatcher', 'MaintenanceMode.MaintenanceMode' ## this line ));
It supports Following Parameters, (*14)
view this is a array that accepts the template and the layout. If layout key is absent it will use the default layout., (*15)
'view' => array( 'template' => 'Pages/index' ),
or, (*16)
'view' => array( 'layout' => 'main', 'template' => 'MaintenanceMode/index' ),
ip_filters this is either a string containing a single IP or an array containing multiple IPs for which maintainance mode will NOT be applied., (*17)
'ip_filters' => array('127.0.*.*','201.201.201.1')
or, (*18)
'ip_filters' => '201.201.201.1'
For info read the docs on dispatch filter, (*19)
http://book.cakephp.org/2.0/en/development/dispatch-filters.html, (*20)
CakePHP Maintenance Mode
MIT
maintenance cakephp dispatcher