bring back the email and logging of update failures, but without the transactions

This commit is contained in:
friendica 2012-04-28 17:50:28 -07:00
parent 8a112aee00
commit 7919d00399
2 changed files with 19 additions and 25 deletions

View file

@ -658,32 +658,26 @@ if(! function_exists('check_config')) {
// call the specific update // call the specific update
// global $db;
// $db->excep(TRUE);
// try {
// $db->beginTransaction();
$func = 'update_' . $x; $func = 'update_' . $x;
$func($a); $retval = $func($a);
// $db->commit(); if($retval) {
// } catch(Exception $ex) { //send the administrator an e-mail
// $db->rollback(); $email_tpl = get_intltext_template("update_fail_eml.tpl");
// //send the administrator an e-mail $email_tpl = replace_macros($email_tpl, array(
// $email_tpl = get_intltext_template("update_fail_eml.tpl"); '$sitename' => $a->config['sitename'],
// $email_tpl = replace_macros($email_tpl, array( '$siteurl' => $a->get_baseurl(),
// '$sitename' => $a->config['sitename'], '$update' => $x,
// '$siteurl' => $a->get_baseurl(), '$error' => sprintf( t('Update %s failed. See error logs.'), $x)
// '$update' => $x, ));
// '$error' => $ex->getMessage())); $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
// $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
// mail($a->config['admin_email'], $subject, $text, mail($a->config['admin_email'], $subject, $text,
// 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
// . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n"
// . 'Content-transfer-encoding: 8bit' ); . 'Content-transfer-encoding: 8bit' );
// //try the logger //try the logger
// logger('update failed: '.$ex->getMessage().EOL); logger('CRITICAL: Update Failed: '. $x);
// } }
// $db->excep(FALSE);
} }
} }
set_config('system','build', DB_UPDATE_VERSION); set_config('system','build', DB_UPDATE_VERSION);