.

OfflineController Class Reference
[Offline]

Actions for setting page on- or offline. More...

Inheritance diagram for OfflineController:
ControllerBase IController IEventSink

List of all members.

Public Member Functions

  action_offline_off (PageData $page_data)
  Switch site offline.
  action_offline_on (PageData $page_data)
  Switch site offline.
  get_routes ()
  Return array of Route instances which are handled by this controller.

Detailed Description

Actions for setting page on- or offline.

Run offline/off or offline/on on the command line using the Console module to switch a site off or online.

The controller modifed the .htaccess file and redirects all requests to /offline.php in the web root.

Author:
Gerd Riesselmann

Definition at line 14 of file offline.controller.php.


Member Function Documentation

OfflineController::action_offline_off ( PageData page_data  ) 

Switch site offline.

Definition at line 30 of file offline.controller.php.

00030                                                                 {
00031                 Load::components('systemupdateinstaller');
00032                 SystemUpdateInstaller::modify_htaccess(
00033                         'offline', 
00034                         SystemUpdateInstaller::HTACCESS_REWRITE, 
00035                         array(
00036                                 'RewriteCond %{REQUEST_URI} ^/index.php',
00037                                 'RewriteRule ^(.*)$ offline.php [L,QSA]'
00038                         )
00039                 );
00040         }
OfflineController::action_offline_on ( PageData page_data  ) 

Switch site offline.

Definition at line 45 of file offline.controller.php.

00045                                                                {
00046                 Load::components('systemupdateinstaller');
00047                 SystemUpdateInstaller::modify_htaccess(
00048                         'offline', 
00049                         SystemUpdateInstaller::HTACCESS_REWRITE, 
00050                         ''
00051                 );
00052         }
OfflineController::get_routes (  ) 

Return array of Route instances which are handled by this controller.

Returns:
array Array of Routes

Reimplemented from ControllerBase.

Definition at line 20 of file offline.controller.php.

00020                                      {
00021                 return array(
00022                         new ExactMatchRoute('offline/off', $this, 'offline_off', new ConsoleOnlyRenderDecorator()),
00023                         new ExactMatchRoute('offline/on', $this, 'offline_on', new ConsoleOnlyRenderDecorator()),
00024                 );
00025         }       

The documentation for this class was generated from the following file: