From 2038b2ec34ff44165932ab9d94db54bc6f924577 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Mon, 26 Oct 2015 09:52:47 +0100
Subject: [PATCH] Fail hard if shipped.json is missing

---
 lib/private/app/appmanager.php | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/lib/private/app/appmanager.php b/lib/private/app/appmanager.php
index 5a932b7dc3f..1f993d8538f 100644
--- a/lib/private/app/appmanager.php
+++ b/lib/private/app/appmanager.php
@@ -297,16 +297,12 @@ class AppManager implements IAppManager {
 	private function loadShippedJson() {
 		if (is_null($this->shippedApps)) {
 			$shippedJson = \OC::$SERVERROOT . '/core/shipped.json';
-			if (file_exists($shippedJson)) {
-				$content = json_decode(file_get_contents($shippedJson), true);
-				$this->shippedApps = $content['shippedApps'];
-				$this->alwaysEnabled = $content['alwaysEnabled'];
-			} else {
-				$this->shippedApps = ['files', 'encryption', 'files_external',
-					'files_sharing', 'files_trashbin', 'files_versions', 'provisioning_api',
-					'user_ldap', 'user_webdavauth'];
-				$this->alwaysEnabled = ['files', 'dav'];
+			if (!file_exists($shippedJson)) {
+				throw new \Exception("File not found: $shippedJson");
 			}
+			$content = json_decode(file_get_contents($shippedJson), true);
+			$this->shippedApps = $content['shippedApps'];
+			$this->alwaysEnabled = $content['alwaysEnabled'];
 		}
 	}
 
-- 
GitLab