Google\Cloud\Storage\StorageClient::bucket PHP Method

bucket() public method

Example: $bucket = $storage->bucket('my-bucket');
public bucket ( string $name ) : Bucket
$name string The name of the bucket to request.
return Bucket
    public function bucket($name)
    {
        return new Bucket($this->connection, $name);
    }

Usage Example

Ejemplo n.º 1
0
 public function testWithStorage()
 {
     $storage = new StorageClient();
     $bucket = $storage->bucket('test-bucket');
     $object = $bucket->object('test-object.jpg');
     $gcsUri = 'gs://test-bucket/test-object.jpg';
     $image = new Image($object, ['landmarks']);
     $res = $image->requestObject();
     $this->assertEquals($res['image']['source']['gcsImageUri'], $gcsUri);
     $this->assertEquals($res['features'], [['type' => 'LANDMARK_DETECTION']]);
 }
All Usage Examples Of Google\Cloud\Storage\StorageClient::bucket