use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\Util\Strings;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\Util\Strings;
- * @param string $basePath The base path of this application
- * @param boolean $via_worker boolean Is the check run via the worker?
+ * @param string $basePath The base path of this application
+ * @param boolean $via_worker Is the check run via the worker?
+ * @param App\Mode $mode The current app mode
+ *
// Compare the current structure with the defined structure
// If the Lock is acquired, never release it automatically to avoid double updates
// Compare the current structure with the defined structure
// If the Lock is acquired, never release it automatically to avoid double updates
// Checks if the build changed during Lock acquiring (so no double update occurs)
$retryBuild = Config::get('system', 'build', null, true);
if ($retryBuild !== $build) {
// Checks if the build changed during Lock acquiring (so no double update occurs)
$retryBuild = Config::get('system', 'build', null, true);
if ($retryBuild !== $build) {
for ($x = $stored + 1; $x <= $current; $x++) {
$r = self::runUpdateFunction($x, 'pre_update');
if (!$r) {
for ($x = $stored + 1; $x <= $current; $x++) {
$r = self::runUpdateFunction($x, 'pre_update');
if (!$r) {
- Logger::log('ERROR: Update from \'' . $stored . '\' to \'' . $current . '\' - failed: ' - $retval, Logger::ALL);
+ Logger::error('Update ERROR.', ['from' => $stored, 'to' => $current, 'retval' => $retval]);
+ Config::set('system', 'update', Update::FAILED);
Lock::release('dbupdate');
return $retval;
} else {
Config::set('database', 'last_successful_update', $current);
Config::set('database', 'last_successful_update_time', time());
Lock::release('dbupdate');
return $retval;
} else {
Config::set('database', 'last_successful_update', $current);
Config::set('database', 'last_successful_update_time', time());
}
// run the update_nnnn functions in update.php
for ($x = $stored + 1; $x <= $current; $x++) {
$r = self::runUpdateFunction($x, 'update');
if (!$r) {
}
// run the update_nnnn functions in update.php
for ($x = $stored + 1; $x <= $current; $x++) {
$r = self::runUpdateFunction($x, 'update');
if (!$r) {
Config::set('database', 'last_successful_update_function', $funcname);
Config::set('database', 'last_successful_update_function_time', time());
Config::set('database', 'last_successful_update_function', $funcname);
Config::set('database', 'last_successful_update_function_time', time());
- Logger::log(sprintf('Cannot notify administrators about update_id=%d, error_message=%s', $update_id, $error_message), Logger::INFO);
+ Logger::warning('Cannot notify administrators .', ['update' => $update_id, 'message' => $error_message]);