Created
January 24, 2019 22:36
-
-
Save aelamel/e27f590fc2c4ad3a816c97bb4f06b2bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Factory; | |
use Google_Service_Storage; | |
class GoogleCloudStorageServiceFactory | |
{ | |
private $configuration; | |
function __construct($cloudStorageConfig) | |
{ | |
$this->configuration = $cloudStorageConfig; | |
} | |
public function createService() { | |
$client = new \Google_Client(); | |
$client->setAuthConfig($this->configuration['key']); | |
$client->setScopes([$this->configuration['scope']]); | |
return new Google_Service_Storage($client); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment