Google\Cloud\Storage\StorageObject::info PHP Method

info() public method

Example: $info = $object->info(); echo $info['size'];
See also: https://cloud.google.com/storage/docs/json_api/v1/objects/get Objects get API documentation.
public info ( array $options = [] ) : array
$options array [optional] { Configuration options. @type string $encryptionKey An AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation in order to retrieve the MD5 hash and CRC32C checksum. If provided one must also include an `encryptionKeySHA256`. @type string $encryptionKeySHA256 The SHA256 hash of the customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation in order to retrieve the MD5 hash and CRC32C checksum. If provided one must also include an `encryptionKey`. @type string $ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. }
return array
    public function info(array $options = [])
    {
        if (!$this->info) {
            $this->reload($options);
        }
        return $this->info;
    }

Usage Example

 public function testGetsInfoWithReload()
 {
     $objectInfo = ['name' => 'object.txt', 'bucket' => 'bucket', 'etag' => 'ABC', 'kind' => 'storage#object'];
     $this->connection->getObject(Argument::any())->willReturn($objectInfo)->shouldBeCalledTimes(1);
     $object = new StorageObject($this->connection->reveal(), 'object.txt', 'bucket');
     $this->assertEquals($objectInfo, $object->info());
 }
All Usage Examples Of Google\Cloud\Storage\StorageObject::info