if(DATABASE_REPLICATION_CHECK)
{
$result = mysql_query("show slave status;");
$row = mysql_fetch_assoc($result);
if( ($row['Slave_IO_Running']!='Yes') || ($row['Slave_SQL_Running']!='Yes') )
{
$fp = fopen('tmp/halt', 'w+');
fclose($fp);
header('Location: index.php');
}
}
Remember to add something like:
if(file_exists('tmp/halt')) exit('Unable to complete request at this time');
at the start of your app execution so as to stop users entering data that can cause all kinds of living nightmares when it comes to patching the data together.
No comments:
Post a Comment