diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-12-18 13:43:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 13:43:58 +0100 |
commit | 97f80f558178b9fc7844148c13b41e52ee4c0c47 (patch) | |
tree | 184778225c079b11285e94e8e3d85eac2ffd3bb3 /lib/private/Installer.php | |
parent | 19ffdecb4f1133ce4899614a9e78fc7640d30260 (diff) | |
parent | 2dbd5052ffe3817b6882697ad96273a8b1f0381b (diff) | |
download | nextcloud-server-97f80f558178b9fc7844148c13b41e52ee4c0c47.tar.gz nextcloud-server-97f80f558178b9fc7844148c13b41e52ee4c0c47.zip |
Merge pull request #7505 from nextcloud/do-not-update-if-app-comes-from-git
Do not update apps if it comes from git
Diffstat (limited to 'lib/private/Installer.php')
-rw-r--r-- | lib/private/Installer.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index eb1f8a456bf..4dcf5a8dad9 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -395,6 +395,10 @@ class Installer { return false; } + if ($this->isInstalledFromGit($appId) === true) { + return false; + } + if ($this->apps === null) { $this->apps = $this->appFetcher->get(); } @@ -415,6 +419,22 @@ class Installer { } /** + * Check if app has been installed from git + * @param string $name name of the application to remove + * @return boolean + * + * The function will check if the path contains a .git folder + */ + private function isInstalledFromGit($appId) { + $app = \OC_App::findAppInDirectories($appId); + if($app === false) { + return false; + } + $basedir = $app['path'].'/'.$appId; + return file_exists($basedir.'/.git/'); + } + + /** * Check if app is already downloaded * @param string $name name of the application to remove * @return boolean |