Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2. class gstorage {
  3.     private $_client;
  4.     private $_storage;
  5.     public function __construct() {
  6.         $scopes = implode(' ', array(
  7.             Google_Service_Storage::DEVSTORAGE_READ_WRITE,
  8.         ));
  9.          
  10.         $this->_client = new Google_Client();
  11.         $jsonAuth = file_get_contents("<FILENAME TO AUTH.JSON>");
  12.         $this->_client->setAuthConfig(json_decode($jsonAuth, true));
  13.         $this->_client->setScopes($scopes);
  14.          
  15.         $this->_storage  = new Google_Service_Storage( $this->_client );
  16.     }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement