aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-28 17:50:28 -0700
committerfriendica <info@friendica.com>2012-04-28 17:50:28 -0700
commit7919d00399e199c34a50f87fd10101d0d8f6f021 (patch)
tree5d1220abb14455e608e747cd5206db70dd800bc1
parent8a112aee0012383c5328021a5b0637957439cbaa (diff)
downloadvolse-hubzilla-7919d00399e199c34a50f87fd10101d0d8f6f021.tar.gz
volse-hubzilla-7919d00399e199c34a50f87fd10101d0d8f6f021.tar.bz2
volse-hubzilla-7919d00399e199c34a50f87fd10101d0d8f6f021.zip
bring back the email and logging of update failures, but without the transactions
-rw-r--r--boot.php44
-rw-r--r--view/en/update_fail_eml.tpl (renamed from view/update_fail_eml.tpl)0
2 files changed, 19 insertions, 25 deletions
diff --git a/boot.php b/boot.php
index 105180c23..7564615a5 100644
--- a/boot.php
+++ b/boot.php
@@ -658,32 +658,26 @@ 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_tpl = 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, $text,
+ '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);
+ }
}
}
set_config('system','build', DB_UPDATE_VERSION);
diff --git a/view/update_fail_eml.tpl b/view/en/update_fail_eml.tpl
index f68a3dece..f68a3dece 100644
--- a/view/update_fail_eml.tpl
+++ b/view/en/update_fail_eml.tpl