From a8f56245792ab0ded70e31b4e858b83dd609aed4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 3 Mar 2026 14:46:16 +0100 Subject: [PATCH] =?UTF-8?q?check=20for=20env=20var=20SEEDDMS=5FEXTENSIONS?= =?UTF-8?q?=20to=20load=20only=20l=D1=96sted=20extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/inc.Extension.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/inc.Extension.php b/inc/inc.Extension.php index 8f9d9f857..1f753f506 100644 --- a/inc/inc.Extension.php +++ b/inc/inc.Extension.php @@ -24,6 +24,10 @@ class_alias('Seeddms\Seeddms\ExtensionMgr', 'SeedDMS_Extension_Mgr'); /* Declare an alias as long as it used by extensions */ class_alias('Seeddms\Seeddms\ExtensionBase', 'SeedDMS_ExtBase'); +$onlyextensions = null; +if (getenv("SEEDDMS_EXTENSIONS")) { + $onlyextensions = explode(',', getenv("SEEDDMS_EXTENSIONS")); +} $extmgr = new ExtensionMgr($settings->_rootDir."/ext", $settings->_cacheDir, $settings->_repositoryUrl, $settings->_proxyUrl, $settings->_proxyUser, $settings->_proxyPassword); foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) { @@ -32,6 +36,10 @@ foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) { $settings->disableExtension($extname); continue; } + if ($onlyextensions && !in_array($extname, $onlyextensions)) { + $settings->disableExtension($extname); + continue; + } if(!$settings->extensionIsDisabled($extname)) { $disabled = false; if($extmgr->checkExtensionByName($extname, $extconf)) {