aboutsummaryrefslogtreecommitdiffstats
path: root/remote.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-09-12 16:17:19 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-09-13 10:08:43 +0200
commit7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc (patch)
treed6c7117c08cd346c300fab6f8de9baedcbaca8a8 /remote.php
parentc9e4598360335d7eab0f4a5153dbf16a1f161351 (diff)
downloadnextcloud-server-7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc.tar.gz
nextcloud-server-7ed583cb8ee64f77696b0e23f79d8d1b4038bcbc.zip
chore: Migrate cleanAppId and getAppPath calls to IAppManager from OC_App
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'remote.php')
-rw-r--r--remote.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/remote.php b/remote.php
index 1cdb74c4139..9b56e6c97f9 100644
--- a/remote.php
+++ b/remote.php
@@ -8,6 +8,7 @@
require_once __DIR__ . '/lib/versioncheck.php';
use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
+use OCP\App\IAppManager;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\Server;
@@ -20,10 +21,7 @@ use Sabre\DAV\Server;
class RemoteException extends \Exception {
}
-/**
- * @param Exception|Error $e
- */
-function handleException($e) {
+function handleException(Exception|Error $e): void {
try {
$request = \OC::$server->getRequest();
// in case the request content type is text/xml - we assume it's a WebDAV request
@@ -126,20 +124,21 @@ try {
// Load all required applications
\OC::$REQUESTEDAPP = $app;
- OC_App::loadApps(['authentication']);
- OC_App::loadApps(['extended_authentication']);
- OC_App::loadApps(['filesystem', 'logging']);
+ $appManager = \OCP\Server::get(IAppManager::class);
+ $appManager->loadApps(['authentication']);
+ $appManager->loadApps(['extended_authentication']);
+ $appManager->loadApps(['filesystem', 'logging']);
switch ($app) {
case 'core':
$file = OC::$SERVERROOT .'/'. $file;
break;
default:
- if (!\OC::$server->getAppManager()->isInstalled($app)) {
+ if (!$appManager->isInstalled($app)) {
throw new RemoteException('App not installed: ' . $app);
}
- OC_App::loadApp($app);
- $file = OC_App::getAppPath($app) .'/'. $parts[1];
+ $appManager->loadApp($app);
+ $file = $appManager->getAppPath($app) .'/'. ($parts[1] ?? '');
break;
}
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';