Browse Source
Merge pull request #7505 from nextcloud/do-not-update-if-app-comes-from-git
Do not update apps if it comes from git
pull/7556/head
Morris Jobke
9 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
20 additions and
0 deletions
-
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(); |
|
|
|
} |
|
|
|
@ -414,6 +418,22 @@ class Installer { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 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 |
|
|
|
|