aboutsummaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-02-08 14:31:34 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-02-08 14:31:34 +0100
commitecfa7c3ca359e732b8bef395edd6be9bd9107b2e (patch)
treede5cc2257fd96f71f076f0ecf43ef6d71f633f5a /cron.php
parent65d013b9aefc2e8c5ae3d1f4c02368f79201e209 (diff)
downloadnextcloud-server-ecfa7c3ca359e732b8bef395edd6be9bd9107b2e.tar.gz
nextcloud-server-ecfa7c3ca359e732b8bef395edd6be9bd9107b2e.zip
chore(cron.php): Migrate uses of legacy classes from lib/private/legacy
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/cron.php b/cron.php
index 1624dcdd6d0..e599f460c13 100644
--- a/cron.php
+++ b/cron.php
@@ -45,6 +45,7 @@ declare(strict_types=1);
require_once __DIR__ . '/lib/versioncheck.php';
use OC\SystemConfig;
+use OCP\App\IAppManager;
use OCP\BackgroundJob\IJobList;
use OCP\IAppConfig;
use OCP\IConfig;
@@ -66,8 +67,15 @@ try {
exit;
}
+ $config = Server::get(IConfig::class);
+
+ // Don't do anything if Nextcloud has not been installed
+ if (!$config->getSystemValueBool('installed', false)) {
+ exit(0);
+ }
+
// load all apps to get all api routes properly setup
- OC_App::loadApps();
+ Server::get(IAppManager::class)->loadApps();
Server::get(ISession::class)->close();
@@ -78,15 +86,9 @@ try {
\OC::$server->setSession($session);
$logger = Server::get(LoggerInterface::class);
- $config = Server::get(IConfig::class);
$appConfig = Server::get(IAppConfig::class);
$tempManager = Server::get(ITempManager::class);
- // Don't do anything if Nextcloud has not been installed
- if (!$config->getSystemValueBool('installed', false)) {
- exit(0);
- }
-
$tempManager->cleanOld();
// Exit if background jobs are disabled!
@@ -183,7 +185,7 @@ try {
}
// clean up after unclean jobs
- \OC_Util::tearDownFS();
+ Server::get(\OC\Files\SetupManager::class)->tearDown();
$tempManager->clean();
$jobList->setLastJob($job);