Skip to content

Commit 292df7d

Browse files
committed
perf: Don't construct Config object twice
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 94b5812 commit 292df7d

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

‎lib/OC.php‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,6 @@ class OC {
107107
* the app path list is empty or contains an invalid path
108108
*/
109109
public static function initPaths(): void {
110-
if (defined('PHPUNIT_CONFIG_DIR')) {
111-
self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
112-
} elseif (defined('PHPUNIT_RUN') && PHPUNIT_RUN && is_dir(OC::$SERVERROOT . '/tests/config/')) {
113-
self::$configDir = OC::$SERVERROOT . '/tests/config/';
114-
} elseif ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
115-
self::$configDir = rtrim($dir, '/') . '/';
116-
} else {
117-
self::$configDir = OC::$SERVERROOT . '/config/';
118-
}
119-
self::$config = new \OC\Config(self::$configDir);
120-
121110
OC::$SUBURI = str_replace('\\', '/', substr(realpath($_SERVER['SCRIPT_FILENAME'] ?? ''), strlen(OC::$SERVERROOT)));
122111
/**
123112
* FIXME: The following lines are required because we can't yet instantiate

0 commit comments

Comments
 (0)