Пример #1
0
 public function getShareableLink(Picture $picture, array $filters = [])
 {
     $config = $this->loadFlysystemConfig();
     $client = new Client($config['token'], $config['app']);
     $adapter = new DropboxAdapter($client);
     $filesystem = new Filesystem($adapter);
     $path = $this->buildFileName($picture, $filters);
     return $filesystem->getAdapter()->getClient()->createShareableLink($path);
 }
Пример #2
0
 public function getShareableLink(Picture $picture, array $filters = [])
 {
     $config = $this->loadFlysystemConfig();
     $client = S3Client::factory(['key' => $config['key'], 'secret' => $config['secret'], 'region' => isset($config['region']) ? $config['region'] : null]);
     $adapter = new AwsS3Adapter($client, $config['bucket']);
     $filesystem = new Filesystem($adapter);
     $key = $this->buildFileName($picture, $filters);
     return $filesystem->getAdapter()->getClient()->getObjectUrl($config['bucket'], $key);
 }