diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-04-29 22:06:16 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-04-29 22:06:16 -0400 |
commit | 34eb843fb486b9487f02553c1b791892bb7615fc (patch) | |
tree | 0cc1e343310753e018c0fb36f9848f227d5eb35a /boot.php | |
parent | ecd1dab373a1fccb1663023f6515ed148475079d (diff) | |
parent | def6f0b408680c4e5f209890bbf1ad6bf40b5add (diff) | |
download | volse-hubzilla-34eb843fb486b9487f02553c1b791892bb7615fc.tar.gz volse-hubzilla-34eb843fb486b9487f02553c1b791892bb7615fc.tar.bz2 volse-hubzilla-34eb843fb486b9487f02553c1b791892bb7615fc.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
the heart should really be red.
fix location change notification
enhanced profile reporting for single values
add db field for removed account, which will also be the first test of update error checking
toggle to archive unfriends, though render them useless
indicate successful updates
diabook-themes: small fix
diabook-themes: bug/css-fixes
some constants for the db update failure possibilities
bring back the email and logging of update failures, but without the transactions
* master:
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 62 |
1 files changed, 34 insertions, 28 deletions
@@ -11,7 +11,7 @@ require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '2.3.1326' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1139 ); +define ( 'DB_UPDATE_VERSION', 1140 ); define ( 'EOL', "<br />\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -74,6 +74,14 @@ define ( 'HOOK_FILE', 1); define ( 'HOOK_FUNCTION', 2); /** + * DB update return values + */ + +define ( 'UPDATE_SUCCESS', 0); +define ( 'UPDATE_FAILED', 1); + + +/** * * page/profile types * @@ -658,32 +666,29 @@ if(! function_exists('check_config')) { // call the specific update -// global $db; -// $db->excep(TRUE); -// try { -// $db->beginTransaction(); - $func = 'update_' . $x; - $func($a); -// $db->commit(); -// } catch(Exception $ex) { -// $db->rollback(); -// //send the administrator an e-mail -// $email_tpl = get_intltext_template("update_fail_eml.tpl"); -// $email_tpl = replace_macros($email_tpl, array( -// '$sitename' => $a->config['sitename'], -// '$siteurl' => $a->get_baseurl(), -// '$update' => $x, -// '$error' => $ex->getMessage())); -// $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); + $func = 'update_' . $x; + $retval = $func($a); + if($retval) { + //send the administrator an e-mail + $email_tpl = get_intltext_template("update_fail_eml.tpl"); + $email_msg = replace_macros($email_tpl, array( + '$sitename' => $a->config['sitename'], + '$siteurl' => $a->get_baseurl(), + '$update' => $x, + '$error' => sprintf( t('Update %s failed. See error logs.'), $x) + )); + $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); -// mail($a->config['admin_email'], $subject, $text, -// 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" -// . 'Content-type: text/plain; charset=UTF-8' . "\n" -// . 'Content-transfer-encoding: 8bit' ); -// //try the logger -// logger('update failed: '.$ex->getMessage().EOL); -// } -// $db->excep(FALSE); + mail($a->config['admin_email'], $subject, $email_msg, + 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + . 'Content-type: text/plain; charset=UTF-8' . "\n" + . 'Content-transfer-encoding: 8bit' ); + //try the logger + logger('CRITICAL: Update Failed: '. $x); + } + else + set_config('database','update_' . $x, 'success'); + } } set_config('system','build', DB_UPDATE_VERSION); @@ -725,9 +730,10 @@ if(! function_exists('check_config')) { foreach($installed as $i) { if(! in_array($i['name'],$plugins_arr)) { uninstall_plugin($i['name']); - } - else + } + else { $installed_arr[] = $i['name']; + } } } |