summaryrefslogtreecommitdiffstats
path: root/core/ajax/update.php
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2023-05-21 23:05:40 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2023-06-03 21:42:51 +0200
commita2afc7b6a9b42598cadcc3d3e9dde80e0a8a9ce4 (patch)
tree214512080370ac8ce227ab60a6f331163db045da /core/ajax/update.php
parent2fd7febffd0ade3f33c8833126c2b8eceabc5d14 (diff)
downloadnextcloud-server-a2afc7b6a9b42598cadcc3d3e9dde80e0a8a9ce4.tar.gz
nextcloud-server-a2afc7b6a9b42598cadcc3d3e9dde80e0a8a9ce4.zip
refactor: migrate OC_EventSource to dependency injection
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core/ajax/update.php')
-rw-r--r--core/ajax/update.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/ajax/update.php b/core/ajax/update.php
index dae08ad0882..1678e30c02e 100644
--- a/core/ajax/update.php
+++ b/core/ajax/update.php
@@ -33,6 +33,7 @@
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IEventSource;
+use OCP\IEventSourceFactory;
use OCP\IL10N;
use OCP\ILogger;
use OC\DB\MigratorExecuteSqlEvent;
@@ -43,6 +44,7 @@ use OC\Repair\Events\RepairInfoEvent;
use OC\Repair\Events\RepairStartEvent;
use OC\Repair\Events\RepairStepEvent;
use OC\Repair\Events\RepairWarningEvent;
+use OCP\L10N\IFactory;
if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
@set_time_limit(0);
@@ -50,9 +52,10 @@ if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
require_once '../../lib/base.php';
-$l = \OC::$server->getL10N('core');
+/** @var \OCP\IL10N $l */
+$l = \OC::$server->get(IFactory::class)->get('core');
-$eventSource = \OC::$server->createEventSource();
+$eventSource = \OC::$server->get(IEventSourceFactory::class)->create();
// need to send an initial message to force-init the event source,
// which will then trigger its own CSRF check and produces its own CSRF error
// message