From: R. M. v. D. <mv...@ca...> - 2003-07-09 17:08:01
|
Greetings, There has been a huge flurry of "blank page" posts on the forums in the past few months. I think we should do something about this... i.e. try and give a meaningful message instead of just the script failing. For example, in include/common.php... if the DatabaseFactory returns 'false', I think we should explicitly print an error and halt the script. (Even if the install goes perfectly, the database setup can change or the database can fail to restart when a machine is rebooted.) Otherwise people get the problem of 'call to a member of a non-object' later on which doesn't really identify the problem (for a non-programmer). I was about to add (after XoopsDatabaseFactory::get()) : if (false === $xoopsDB) { echo "ERROR: Could not connect to database. Please check your settings in mainfile.php"; exit; } But it seems like maybe xoops could benefit from a centralized mechanism for doing this. Perhaps we can provide a custom error handler (set_error_handler) and use trigger_error? Or maybe the 'echo/exit' combination is good enough? Database failure seems to be the most common cause of the blank page problem... I'm not sure if we can catch many others... some are due to corrupt files (resulting in parse error or undefined function, which I don't think we can 'catch' with a custom error handler)... Any suggestions on the best way to do this? Best regards, Mike |