From 292df7d9af64fc1c409b8b9feead0b8b22c582c4 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 27 Jul 2026 12:13:57 +0200 Subject: [PATCH] perf: Don't construct Config object twice Signed-off-by: Carl Schwan --- lib/OC.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/OC.php b/lib/OC.php index 5b72d243ded14..b2b4f65fee004 100644 --- a/lib/OC.php +++ b/lib/OC.php @@ -107,17 +107,6 @@ class OC { * the app path list is empty or contains an invalid path */ public static function initPaths(): void { - if (defined('PHPUNIT_CONFIG_DIR')) { - self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/'; - } elseif (defined('PHPUNIT_RUN') && PHPUNIT_RUN && is_dir(OC::$SERVERROOT . '/tests/config/')) { - self::$configDir = OC::$SERVERROOT . '/tests/config/'; - } elseif ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) { - self::$configDir = rtrim($dir, '/') . '/'; - } else { - self::$configDir = OC::$SERVERROOT . '/config/'; - } - self::$config = new \OC\Config(self::$configDir); - OC::$SUBURI = str_replace('\\', '/', substr(realpath($_SERVER['SCRIPT_FILENAME'] ?? ''), strlen(OC::$SERVERROOT))); /** * FIXME: The following lines are required because we can't yet instantiate