port db update improvements from zap

This commit is contained in:
Mario Vavti
2019-05-03 15:13:13 +02:00
parent 98b6362c07
commit 1da4602567
4 changed files with 67 additions and 9 deletions

View File

@@ -58,10 +58,15 @@ class DB_Upgrade {
$c = new $cls();
$retval = $c->run();
if($retval != UPDATE_SUCCESS) {
$source = t('Source code of failed update: ') . "\n\n" . @file_get_contents('Zotlabs/Update/' . $s . '.php');
// Prevent sending hundreds of thousands of emails by creating
// a lockfile.
@@ -86,7 +91,9 @@ class DB_Upgrade {
'$sitename' => \App::$config['system']['sitename'],
'$siteurl' => z_root(),
'$update' => $x,
'$error' => sprintf( t('Update %s failed. See error logs.'), $x)
'$error' => sprintf( t('Update %s failed. See error logs.'), $x),
'$baseurl' => z_root(),
'$source' => $source
]
)
]