diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2022-09-15 08:15:25 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2022-09-15 08:15:33 -0100 |
commit | 0efd6d995037bc34de714024f137fecdbdc50a69 (patch) | |
tree | fd187d0751321f586affd2152f3f170af0ab1fdc /lib/private/App | |
parent | 4c1f06170e1f7256bdc0791c40359c5ab6ad5eda (diff) | |
download | nextcloud-server-0efd6d995037bc34de714024f137fecdbdc50a69.tar.gz nextcloud-server-0efd6d995037bc34de714024f137fecdbdc50a69.zip |
set defaultEnabled in shipped.json
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/private/App')
-rw-r--r-- | lib/private/App/AppManager.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index f154bd854ad..6d2fe51d0ed 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -13,6 +13,7 @@ * @author Julius Haertl <jus@bitgrid.net> * @author Julius Härtl <jus@bitgrid.net> * @author Lukas Reschke <lukas@statuscode.ch> + * @author Maxence Lange <maxence@artificial-owl.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <robin@icewind.nl> * @author Roeland Jago Douma <roeland@famdouma.nl> @@ -91,8 +92,8 @@ class AppManager implements IAppManager { /** @var string[] */ private $shippedApps; - /** @var string[] */ - private $alwaysEnabled; + private array $alwaysEnabled = []; + private array $defaultEnabled = []; /** @var array */ private $appInfos = []; @@ -574,6 +575,7 @@ class AppManager implements IAppManager { $content = json_decode(file_get_contents($shippedJson), true); $this->shippedApps = $content['shippedApps']; $this->alwaysEnabled = $content['alwaysEnabled']; + $this->defaultEnabled = $content['defaultEnabled']; } } @@ -584,4 +586,20 @@ class AppManager implements IAppManager { $this->loadShippedJson(); return $this->alwaysEnabled; } + + /** + * @inheritdoc + */ + public function isDefaultEnabled(string $appId): bool { + return (in_array($appId, $this->getDefaultEnabledApps())); + } + + /** + * @inheritdoc + */ + public function getDefaultEnabledApps():array { + $this->loadShippedJson(); + + return $this->defaultEnabled; + } } |