turn off update transactions until we figure out how to do them safely.

This commit is contained in:
friendica 2012-04-12 05:45:28 -07:00
parent 5a78400f37
commit 7eb1fbb41f

View File

@ -657,32 +657,32 @@ if(! function_exists('check_config')) {
// call the specific update // call the specific update
global $db; // global $db;
$db->excep(TRUE); // $db->excep(TRUE);
try { // try {
$db->beginTransaction(); // $db->beginTransaction();
$func = 'update_' . $x; $func = 'update_' . $x;
$func($a); $func($a);
$db->commit(); // $db->commit();
} catch(Exception $ex) { // } catch(Exception $ex) {
$db->rollback(); // $db->rollback();
//send the administrator an e-mail // //send the administrator an e-mail
$email_tpl = get_intltext_template("update_fail_eml.tpl"); // $email_tpl = get_intltext_template("update_fail_eml.tpl");
$email_tpl = replace_macros($email_tpl, array( // $email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'], // '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), // '$siteurl' => $a->get_baseurl(),
'$update' => $x, // '$update' => $x,
'$error' => $ex->getMessage())); // '$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('update failed: '.$ex->getMessage().EOL);
} // }
$db->excep(FALSE); // $db->excep(FALSE);
} }
} }
set_config('system','build', DB_UPDATE_VERSION); set_config('system','build', DB_UPDATE_VERSION);