Skip to content

Instantly share code, notes, and snippets.

@aelamel
Created January 24, 2019 22:36
Show Gist options
  • Save aelamel/e27f590fc2c4ad3a816c97bb4f06b2bf to your computer and use it in GitHub Desktop.
Save aelamel/e27f590fc2c4ad3a816c97bb4f06b2bf to your computer and use it in GitHub Desktop.
<?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