Skip to content

Commit

Permalink
Avoid Nextcloud from failing if files_external is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
NastuzziSamy committed Mar 12, 2019
1 parent ca5386d commit b05bf4b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
11 changes: 7 additions & 4 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
*
*/

if ((@include_once(dirname(__DIR__).'/vendor/autoload.php')) === false)
throw new \Exception('Cannot include autoload. Did you run install dependencies using composer?');
if ((@include_once(dirname(__DIR__).'/vendor/autoload.php')) === false) {
throw new \Exception('Cannot include autoload. Did you install dependencies using composer?');
}

$app = new \OCA\Files_external_gdrive\AppInfo\Application();
$app->register();
if (\OC::$server->getAppManager()->isEnabledForUser('files_external')) {
$app = new \OCA\Files_external_gdrive\AppInfo\Application();
$app->register();
}
14 changes: 8 additions & 6 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
*
*/

$application = new \OCA\Files_external_gdrive\AppInfo\Application();
$application->registerRoutes($this, [
'routes' => [
['name' => 'oauth#receiveToken', 'url' => '/oauth', 'verb' => 'POST'],
],
]);
if (\OC::$server->getAppManager()->isEnabledForUser('files_external')) {
$application = new \OCA\Files_external_gdrive\AppInfo\Application();
$application->registerRoutes($this, [
'routes' => [
['name' => 'oauth#receiveToken', 'url' => '/oauth', 'verb' => 'POST'],
],
]);
}

0 comments on commit b05bf4b

Please sign in to comment.