Author: Michael Dowling (mtdowling@gmail.com)
Inheritance: implements Gaufrette\Adapter, implements Gaufrette\Adapter\MetadataSupporter, implements Gaufrette\Adapter\ListKeysAware, implements Gaufrette\Adapter\SizeCalculator
コード例 #1
0
ファイル: S3.php プロジェクト: vegas-cmf/filesystem
 /**
  * Returns the url for file
  * By default absolute path to file is returned
  * Otherwise when $options array contain key `relative` set as true, relative path will be returned
  *
  * @param $key
  * @param array $options
  * @return mixed
  */
 public function getUrl($key, array $options = [])
 {
     $url = parent::getUrl($key, $options);
     if (isset($options['relative']) && $options['relative']) {
         $url = parse_url($url, PHP_URL_PATH);
     }
     return $url;
 }
コード例 #2
0
 public function testGetsObjectUrlsWithDirectory()
 {
     $client = $this->getClient();
     $adapter = new AwsS3($client, 'bucket', array('directory' => 'bar'));
     $this->assertEquals('https://bucket.s3.amazonaws.com/bar/foo', $adapter->getUrl('foo'));
 }
コード例 #3
0
ファイル: AwsS3Test.php プロジェクト: NiR-/Gaufrette
 public function shouldListKeysWithoutDirectory()
 {
     $client = $this->getClient();
     $adapter = new AwsS3($client, 'bucket', array('directory' => 'bar'));
     $adapter->write('test.txt', 'some content');
     $keys = $adapter->listKeys();
     $this->assertEquals('test.txt', $keys['key']);
 }