-
Notifications
You must be signed in to change notification settings - Fork 26
I want to take my site offline for maintenance rogierb
This is my first attempt to creat a WIKI page so bare with me.
[h2]Overview[/h2]
This approach relies on the build-in hook system.
[h2]Approach[/h2]
[h4]Step one[/h4] First of all we need to enable hooks. If you have already done so, skip to the next step
You have to edit the config.php file to enable hooks. Set the $config['enable_hooks'] to TRUE like so: [code] $config['enable_hooks'] = TRUE; [/code] You can find the file in the application/config folder
[h4]Step two[/h4] In the same file a new config item is introduced: $config['is_offline'] At the bottom ( just before the 'end of config.php') insert the following code: [code]
/* |
---|
Maintenance site |
-------------------------------------------------------------------------- |
| | For whatever reason sometimes a site needs to be taken offline. | Set $config['is_offline'] to TRUE if the site has to be offline | | $config['is_offline'] = TRUE; // site is offline | $config['is_offline'] = FALSE; // site is online */
$config['is_offline'] = FALSE; [/code]
[h4]Step three[/h4] To let the system know what hook to use we need to edit hooks.php. This is in the application/config folder aswell
you need to insert the follwing code [code] $hook['pre_system'][] = array( 'class' => 'site_offline_hook', 'function' => 'is_offline', 'filename' => 'site_offline_hook.php', 'filepath' => 'hooks' ); [/code]