Replace Logger with DI::logger() in update.php

This commit is contained in:
Art4 2025-01-13 08:54:34 +00:00
parent 6fc6fa0f41
commit 16d3c36391

View file

@ -95,7 +95,7 @@ function update_1298()
$fail++; $fail++;
} else { } else {
DBA::update('profile', [$translateKey => $key], ['id' => $data['id']]); DBA::update('profile', [$translateKey => $key], ['id' => $data['id']]);
Logger::notice('Updated contact', ['action' => 'update', 'contact' => $data['id'], "$translateKey" => $key, DI::logger()->notice('Updated contact', ['action' => 'update', 'contact' => $data['id'], "$translateKey" => $key,
'was' => $data[$translateKey]]); 'was' => $data[$translateKey]]);
Contact::updateSelfFromUserID($data['id']); Contact::updateSelfFromUserID($data['id']);
@ -105,7 +105,7 @@ function update_1298()
} }
} }
Logger::notice($translateKey . ' fix completed', ['action' => 'update', 'translateKey' => $translateKey, 'Success' => $success, 'Fail' => $fail ]); DI::logger()->notice($translateKey . ' fix completed', ['action' => 'update', 'translateKey' => $translateKey, 'Success' => $success, 'Fail' => $fail ]);
} }
return Update::SUCCESS; return Update::SUCCESS;
} }
@ -126,7 +126,7 @@ function update_1309()
$deliver_options = ['priority' => Worker::PRIORITY_MEDIUM, 'dont_fork' => true]; $deliver_options = ['priority' => Worker::PRIORITY_MEDIUM, 'dont_fork' => true];
Worker::add($deliver_options, 'Delivery', Delivery::POST, $item['id'], $entry['cid']); Worker::add($deliver_options, 'Delivery', Delivery::POST, $item['id'], $entry['cid']);
Logger::info('Added delivery worker', ['item' => $item['id'], 'contact' => $entry['cid']]); DI::logger()->info('Added delivery worker', ['item' => $item['id'], 'contact' => $entry['cid']]);
DBA::delete('queue', ['id' => $entry['id']]); DBA::delete('queue', ['id' => $entry['id']]);
} }
return Update::SUCCESS; return Update::SUCCESS;
@ -1388,7 +1388,7 @@ function update_1535()
DI::config()->set('system', 'compute_circle_counts', true); DI::config()->set('system', 'compute_circle_counts', true);
} }
DI::config()->delete('system', 'compute_group_counts'); DI::config()->delete('system', 'compute_group_counts');
return Update::SUCCESS; return Update::SUCCESS;
} }