Méthode | Description | |
---|---|---|
__construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $name, array $info = null ) | ||
acl ( ) : |
Configure ACL for this bucket. | |
compose ( array $sourceObjects, string $name, array $options = [] ) : |
Composes a set of objects into a single object. | |
defaultAcl ( ) : |
Configure default object ACL for this bucket. | |
delete ( array $options = [] ) : void | Delete the bucket. | |
exists ( ) : boolean | Check whether or not the bucket exists. | |
getResumableUploader ( string | resource | Psr\Http\Message\StreamInterface $data, array $options = [] ) : |
Get a resumable uploader which can provide greater control over the upload process. This is recommended when dealing with large files where reliability is key. | |
info ( array $options = [] ) : array | Retrieves the bucket's details. If no bucket data is cached a network request will be made to retrieve it. | |
name ( ) : string | Retrieves the bucket's name. | |
object ( string $name, array $options = [] ) : |
Lazily instantiates an object. There are no network requests made at this point. To see the operations that can be performed on an object please see {@see Google\Cloud\Storage\StorageObject}. | |
objects ( array $options = [] ) : Generator |
Fetches all objects in the bucket. | |
reload ( array $options = [] ) : array | Triggers a network request to reload the bucket's details. | |
update ( array $options = [] ) : array | Update the bucket. Upon receiving a result the local bucket's data will be updated. | |
upload ( string | resource | Psr\Http\Message\StreamInterface $data, array $options = [] ) : |
Upload your data in a simple fashion. Uploads will default to being resumable if the file size is greater than 5mb. |
public __construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $name, array $info = null ) | ||
$connection | Google\Cloud\Storage\Connection\ConnectionInterface | Represents a connection to Cloud Storage. |
$name | string | The bucket's name. |
$info | array | [optional] The bucket's metadata. |
public acl ( ) : |
||
Résultat | An ACL instance configured to handle the bucket's access control policies. |
public compose ( array $sourceObjects, string $name, array $options = [] ) : |
||
$sourceObjects | array | The objects to compose. |
$name | string | The name of the composed object. |
$options | array | [optional] { Configuration options. @type string $predefinedAcl Predefined ACL to apply to the composed object. Acceptable values include, `"authenticatedRead"`, `"bucketOwnerFullControl"`, `"bucketOwnerRead"`, `"private"`, `"projectPrivate"`, and `"publicRead"`. **Defaults to** `"private"`. @type array $metadata Metadata to apply to the composed object. The available options for metadata are outlined at the [JSON API docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request-body). @type string $ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. } |
Résultat |
public defaultAcl ( ) : |
||
Résultat | An ACL instance configured to handle the bucket's default object access control policies. |
public delete ( array $options = [] ) : void | ||
$options | array | [optional] { Configuration options. @type string $ifMetagenerationMatch If set, only deletes the bucket if its metageneration matches this value. @type string $ifMetagenerationNotMatch If set, only deletes the bucket if its metageneration does not match this value. } |
Résultat | void |
public getResumableUploader ( string | resource | Psr\Http\Message\StreamInterface $data, array $options = [] ) : |
||
$data | string | resource | Psr\Http\Message\StreamInterface | The data to be uploaded. |
$options | array | [optional] { Configuration options. @type string $name The name of the destination. @type bool $validate Indicates whether or not validation will be applied using md5 hashing functionality. If true and the calculated hash does not match that of the upstream server the upload will be rejected. @type int $chunkSize If provided the upload will be done in chunks. The size must be in multiples of 262144 bytes. With chunking you have increased reliability at the risk of higher overhead. It is recommended to not use chunking. @type string $predefinedAcl Predefined ACL to apply to the object. Acceptable values include `"authenticatedRead`", `"bucketOwnerFullControl`", `"bucketOwnerRead`", `"private`", `"projectPrivate`", and `"publicRead"`. **Defaults to** `"private"`. @type array $metadata The available options for metadata are outlined at the [JSON API docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request-body). @type string $encryptionKey A base64 encoded AES-256 customer-supplied encryption key. @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. } |
Résultat |
public info ( array $options = [] ) : array | ||
$options | array | [optional] { Configuration options. @type string $ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. } |
Résultat | array |
public object ( string $name, array $options = [] ) : |
||
$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. } |
Résultat |
public objects ( array $options = [] ) : Generator |
||
$options | array | [optional] { Configuration options. @type string $delimiter Returns results in a directory-like mode. Results will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. @type integer $maxResults Maximum number of results to return per request. Defaults to `1000`. @type string $prefix Filter results with this prefix. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. @type bool $versions If true, lists all versions of an object as distinct results. The default is false. @type string $fields Selector which will cause the response to only return the specified fields. } |
Résultat | Generator |
public reload ( array $options = [] ) : array | ||
$options | array | [optional] { Configuration options. @type string $ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. } |
Résultat | array |
public update ( array $options = [] ) : array | ||
$options | array | [optional] { Configuration options. @type string $ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. @type string $predefinedAcl Apply a predefined set of access controls to this bucket. @type string $predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. @type string $fields Selector which will cause the response to only return the specified fields. @type array $acl Access controls on the bucket. @type array $cors The bucket's Cross-Origin Resource Sharing (CORS) configuration. @type array $defaultObjectAcl Default access controls to apply to new objects when no ACL is provided. @type array $lifecycle The bucket's lifecycle configuration. @type array $logging The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. @type array $versioning The bucket's versioning configuration. @type array $website The bucket's website configuration. } |
Résultat | array |
public upload ( string | resource | Psr\Http\Message\StreamInterface $data, array $options = [] ) : |
||
$data | string | resource | Psr\Http\Message\StreamInterface | The data to be uploaded. |
$options | array | [optional] { Configuration options. @type string $name The name of the destination. @type bool $resumable Indicates whether or not the upload will be performed in a resumable fashion. @type bool $validate Indicates whether or not validation will be applied using md5 hashing functionality. If true and the calculated hash does not match that of the upstream server the upload will be rejected. @type int $chunkSize If provided the upload will be done in chunks. The size must be in multiples of 262144 bytes. With chunking you have increased reliability at the risk of higher overhead. It is recommended to not use chunking. @type string $predefinedAcl Predefined ACL to apply to the object. Acceptable values include, `"authenticatedRead"`, `"bucketOwnerFullControl"`, `"bucketOwnerRead"`, `"private"`, `"projectPrivate"`, and `"publicRead"`. **Defaults to** `"private"`. @type array $metadata The available options for metadata are outlined at the [JSON API docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request-body). @type string $encryptionKey A base64 encoded AES-256 customer-supplied encryption key. @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. } |
Résultat |