diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-02-11 23:07:49 -0800 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-02-11 23:07:49 -0800 |
commit | 986068d6e7119e17509f228857d55873b34da28f (patch) | |
tree | 54cad05a538869185774ecc3bb8caf0772392e71 /index.php | |
parent | 7155cf813de1502e796c0eac1e680289f3552c29 (diff) | |
parent | 616bdd43a921b2554d21b80af28ddb0fb6cb3c16 (diff) |
Merge branch '0.7.x' into queuehandlers
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -25,7 +25,8 @@ require_once INSTALLDIR . '/lib/common.php'; $user = null; $action = null; -function getPath($req) { +function getPath($req) +{ if (common_config('site', 'fancy')) { return $req['p']; } else if ($_SERVER['PATH_INFO']) { @@ -35,10 +36,30 @@ function getPath($req) { } } -function main() { +function handleError($error) +{ + common_log(LOG_ERR, "PEAR error: " . $error->getMessage()); + $msg = sprintf(_('The database for %s isn\'t responding correctly, '. + 'so the site won\'t work properly. '. + 'The site admins probably know about the problem, '. + 'but you can contact them at %s to make sure. '. + 'Otherwise, wait a few minutes and try again.'), + common_config('site', 'name'), + common_config('site', 'email')); + + $dac = new DBErrorAction($msg, 500); + $dac->showPage(); + exit(-1); +} +function main() +{ global $user, $action; + // For database errors + + PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError'); + // XXX: we need a little more structure in this script // get and cache current user |