object() public method

Example: $object = $bucket->object('file.txt');
public object ( string $name, array $options = [] ) : StorageObject
$name string The name of the object to request.
$options array [optional] { Configuration options. @type string $generation Request a specific revision of the object. @type string $encryptionKey A base64 encoded AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. @type string $encryptionKeySHA256 Base64 encoded SHA256 hash of the customer-supplied encryption key. This value will be calculated from the `encryptionKey` on your behalf if not provided, but for best performance it is recommended to pass in a cached version of the already calculated SHA. }
return StorageObject
Esempio n. 1
0
 public function testInstantiateObjectWithGeneration()
 {
     $bucket = new Bucket($this->connection->reveal(), 'bucket');
     $object = $bucket->object('peter-venkman.jpg', ['generation' => '5']);
     $this->assertInstanceOf('Google\\Cloud\\Storage\\StorageObject', $object);
 }
 public function testInstantiateObjectWithOptions()
 {
     $bucket = new Bucket($this->connection->reveal(), 'bucket');
     $object = $bucket->object('peter-venkman.jpg', ['generation' => '5', 'encryptionKey' => 'abc', 'encryptionKeySHA256' => '123']);
     $this->assertInstanceOf('Google\\Cloud\\Storage\\StorageObject', $object);
 }
 /**
  * Returns a storage object for the given path.
  *
  * @param string $path
  * @return \Google\Cloud\Storage\StorageObject
  */
 protected function getObject($path)
 {
     $path = $this->applyPathPrefix($path);
     return $this->bucket->object($path);
 }