private $apps = null;
/** @var bool|null - for caching the result of the ready status */
private $isInstanceReadyForUpdates = null;
+ /** @var bool */
+ private $isCLI;
/**
* @param AppFetcher $appFetcher
* @param ILogger $logger
* @param IConfig $config
*/
- public function __construct(AppFetcher $appFetcher,
- IClientService $clientService,
- ITempManager $tempManager,
- ILogger $logger,
- IConfig $config) {
+ public function __construct(
+ AppFetcher $appFetcher,
+ IClientService $clientService,
+ ITempManager $tempManager,
+ ILogger $logger,
+ IConfig $config,
+ bool $isCLI
+ ) {
$this->appFetcher = $appFetcher;
$this->clientService = $clientService;
$this->tempManager = $tempManager;
$this->logger = $logger;
$this->config = $config;
+ $this->isCLI = $isCLI;
}
/**
// Download the release
$tempFile = $this->tempManager->getTemporaryFile('.tar.gz');
+ $timeout = $this->isCLI ? 0 : 120;
$client = $this->clientService->newClient();
- $client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => 120]);
+ $client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => $timeout]);
// Check if the signature actually matches the downloaded content
$certificate = openssl_get_publickey($app['certificate']);
$c->getHTTPClientService(),
$c->getTempManager(),
$c->getLogger(),
- $c->getConfig()
+ $c->getConfig(),
+ \OC::$CLI
);
});
\OC::$server->getHTTPClientService(),
\OC::$server->getTempManager(),
\OC::$server->getLogger(),
- $config
+ $config,
+ false
);
$installer->removeApp(self::$appid);
}
$this->clientService,
$this->tempManager,
$this->logger,
- $this->config
+ $this->config,
+ false
);
}
\OC::$server->getHTTPClientService(),
\OC::$server->getTempManager(),
\OC::$server->getLogger(),
- \OC::$server->getConfig()
+ \OC::$server->getConfig(),
+ false
);
$installer->removeApp(self::$appid);
\OC::$server->getConfig()->setSystemValue('appstoreenabled', $this->appstore);
\OC::$server->getHTTPClientService(),
\OC::$server->getTempManager(),
\OC::$server->getLogger(),
- \OC::$server->getConfig()
+ \OC::$server->getConfig(),
+ false
);
$this->assertNull(\OC::$server->getConfig()->getAppValue('testapp', 'enabled', null), 'Check that the app is not listed before installation');
$this->assertSame('testapp', $installer->installApp(self::$appid));