summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/google.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-21 16:18:44 +0200
committerVincent Petry <pvince81@owncloud.com>2014-10-22 12:42:36 +0200
commit075e8d8e8658913e1c5b8869f3e457fa6db2d847 (patch)
tree580bd57f2d440fdb606b2ba0d9fc67dfd1e76796 /apps/files_external/lib/google.php
parenta9aa7841c94f8ea2ed924c6e59ea9119295ae775 (diff)
downloadnextcloud-server-075e8d8e8658913e1c5b8869f3e457fa6db2d847.tar.gz
nextcloud-server-075e8d8e8658913e1c5b8869f3e457fa6db2d847.zip
Lazy initialize external storages
Fixed the following external storages to not connect in the constructor, but do it on-demand when getConnection() is called. - S3 - SWIFT - SFTP
Diffstat (limited to 'apps/files_external/lib/google.php')
-rw-r--r--apps/files_external/lib/google.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 5d238a363de..62b0f182e98 100644
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -52,6 +52,7 @@ class Google extends \OC\Files\Storage\Common {
$client->setScopes(array('https://www.googleapis.com/auth/drive'));
$client->setUseObjects(true);
$client->setAccessToken($params['token']);
+ // note: API connection is lazy
$this->service = new \Google_DriveService($client);
$token = json_decode($params['token'], true);
$this->id = 'google::'.substr($params['client_id'], 0, 30).$token['created'];