(time() - 86400))) return; @unlink($lockfile); //send the administrator an e-mail file_put_contents($lockfile, $x); $r = q("select account_language from account where account_email = '%s' limit 1", dbesc(App::$config['system']['admin_email']) ); push_lang(($r) ? $r[0]['account_language'] : 'en'); z_mail( [ 'toEmail' => \App::$config['system']['admin_email'], 'messageSubject' => sprintf( t('Update Error at %s'), z_root()), 'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'), [ '$sitename' => \App::$config['system']['sitename'], '$siteurl' => z_root(), '$update' => $x, '$error' => sprintf( t('Update %s failed. See error logs.'), $x) ] ) ] ); //try the logger logger('CRITICAL: Update Failed: ' . $x); pop_lang(); } else { set_config('database',$func, 'success'); } } } set_config('system', PLATFORM_NAME . '_db_version', $db_revision); } } } } }