summaryrefslogtreecommitdiffstats
path: root/lib/private/Installer.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-04-30 09:43:33 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-07 13:51:39 +0200
commit9e962fb69f0afa12eeec3d2e412648a5e432588c (patch)
tree5277d4d9e6aebf3ad7bb18fc530507abd945a7e9 /lib/private/Installer.php
parenta3d30bf4a23f3827103dd3ba5e10c16a58362a80 (diff)
downloadnextcloud-server-9e962fb69f0afa12eeec3d2e412648a5e432588c.tar.gz
nextcloud-server-9e962fb69f0afa12eeec3d2e412648a5e432588c.zip
Allow to update to nightly
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/Installer.php')
-rw-r--r--lib/private/Installer.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index d5c9d076eda..9be79ac72bb 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -189,12 +189,13 @@ class Installer {
* Updates the specified app from the appstore
*
* @param string $appId
+ * @param bool [$allowUnstable] Allow unstable releases
* @return bool
*/
- public function updateAppstoreApp($appId) {
- if ($this->isUpdateAvailable($appId)) {
+ public function updateAppstoreApp($appId, $allowUnstable = false) {
+ if ($this->isUpdateAvailable($appId, $allowUnstable)) {
try {
- $this->downloadApp($appId);
+ $this->downloadApp($appId, $allowUnstable);
} catch (\Exception $e) {
$this->logger->logException($e, [
'level' => ILogger::ERROR,
@@ -212,13 +213,14 @@ class Installer {
* Downloads an app and puts it into the app directory
*
* @param string $appId
+ * @param bool [$allowUnstable]
*
* @throws \Exception If the installation was not successful
*/
- public function downloadApp($appId) {
+ public function downloadApp($appId, $allowUnstable = false) {
$appId = strtolower($appId);
- $apps = $this->appFetcher->get();
+ $apps = $this->appFetcher->get($allowUnstable);
foreach ($apps as $app) {
if ($app['id'] === $appId) {
// Load the certificate
@@ -384,9 +386,10 @@ class Installer {
* Check if an update for the app is available
*
* @param string $appId
+ * @param bool $allowUnstable
* @return string|false false or the version number of the update
*/
- public function isUpdateAvailable($appId) {
+ public function isUpdateAvailable($appId, $allowUnstable = false) {
if ($this->isInstanceReadyForUpdates === null) {
$installPath = OC_App::getInstallPath();
if ($installPath === false || $installPath === null) {
@@ -405,7 +408,7 @@ class Installer {
}
if ($this->apps === null) {
- $this->apps = $this->appFetcher->get();
+ $this->apps = $this->appFetcher->get($allowUnstable);
}
foreach ($this->apps as $app) {