Skip to content

I want to take my site offline for maintenance rogierb

World Wide Web Server edited this page Jul 4, 2012 · 15 revisions

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] 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]

Clone this wiki locally