Welcome Guest, Not a member yet? Register   Sign In
Making site offline
#2

[eluser]Ty Bex[/eluser]
HIGH LEVEL DETAILS:

This is not a perfect solution but it will work.
This is only requre a local file read and no db connectivity.

1.) Create a file called "site_status.txt"
2.) The content of the file is a simple "1" for server up and "0" for server down.
3.) Write a library "l_stite_status.php" that opens and reads the value and sets a variable to 1 or 0 "var_site_status"
4.) Autoload the library
5.) In every class or at a higher level with a hook in codeigniter call the library and check if the value is a 1 or 0
6.) If there var_site_status equals 0 then redirect to a site is down for maintenance static html page.

Now just have your cron over write a 1 or 0 to the site_status.txt


Messages In This Thread
Making site offline - by El Forum - 01-23-2009, 12:50 PM
Making site offline - by El Forum - 01-23-2009, 01:45 PM
Making site offline - by El Forum - 01-23-2009, 03:52 PM
Making site offline - by El Forum - 01-23-2009, 04:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB