PHP 클래스 Google\Cloud\Storage\StorageClient

Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $storage = $cloud->storage(); StorageClient can be instantiated directly. use Google\Cloud\Storage\StorageClient; $storage = new StorageClient();
상속: use trait Google\Cloud\ClientTrait
파일 보기 프로젝트 열기: GoogleCloudPlatform/gcloud-php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$connection Google\Cloud\Storage\Connection\ConnectionInterface Represents a connection to Storage.

공개 메소드들

메소드 설명
__construct ( array $config = [] ) Create a Storage client.
bucket ( string $name ) : Bucket Lazily instantiates a bucket. There are no network requests made at this point. To see the operations that can be performed on a bucket please see {@see Google\Cloud\Storage\Bucket}.
buckets ( array $options = [] ) : Generator Fetches all buckets in the project.
createBucket ( string $name, array $options = [] ) : Bucket Create a bucket. Bucket names must be unique as Cloud Storage uses a flat namespace. For more information please see bucket name requirements

메소드 상세

__construct() 공개 메소드

Create a Storage client.
public __construct ( array $config = [] )
$config array [optional] { Configuration options. @type string $projectId The project ID from the Google Developer's Console. @type CacheItemPoolInterface $authCache A cache used storing access tokens. **Defaults to** a simple in memory implementation. @type array $authCacheOptions Cache configuration options. @type callable $authHttpHandler A handler used to deliver Psr7 requests specifically for authentication. @type callable $httpHandler A handler used to deliver Psr7 requests. Only valid for requests sent over REST. @type string $keyFile The contents of the service account credentials .json file retrieved from the Google Developers Console. @type string $keyFilePath The full path to your service account credentials .json file retrieved from the Google Developers Console. @type int $retries Number of retries for a failed request. **Defaults to** `3`. @type array $scopes Scopes to be used for the request. }

bucket() 공개 메소드

Example: $bucket = $storage->bucket('my-bucket');
public bucket ( string $name ) : Bucket
$name string The name of the bucket to request.
리턴 Bucket

buckets() 공개 메소드

Example: $buckets = $storage->buckets(); Get all buckets beginning with the prefix 'album'. $buckets = $storage->buckets([ 'prefix' => 'album' ]); foreach ($buckets as $bucket) { echo $bucket->name() . PHP_EOL; }
또한 보기: https://cloud.google.com/storage/docs/json_api/v1/buckets/list Buckets list API documentation.
public buckets ( array $options = [] ) : Generator
$options array [optional] { Configuration options. @type integer $maxResults Maximum number of results to return per request. @type string $prefix Filter results with this prefix. @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. }
리턴 Generator

createBucket() 공개 메소드

Example: $bucket = $storage->createBucket('bucket'); Create a bucket with logging enabled. $bucket = $storage->createBucket('myBeautifulBucket', [ 'logging' => [ 'logBucket' => 'bucketToLogTo', 'logObjectPrefix' => 'myPrefix' ] ]);
또한 보기: https://cloud.google.com/storage/docs/json_api/v1/buckets/insert Buckets insert API documentation.
public createBucket ( string $name, array $options = [] ) : Bucket
$name string Name of the bucket to be created.
$options array [optional] { Configuration options. @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 string $location The location of the bucket. **Defaults to** `"US"`. @type array $logging The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. @type string $storageClass The bucket's storage class. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD and DURABLE_REDUCED_AVAILABILITY. @type array $versioning The bucket's versioning configuration. @type array $website The bucket's website configuration. }
리턴 Bucket

프로퍼티 상세

$connection 보호되어 있는 프로퍼티

Represents a connection to Storage.
protected ConnectionInterface,Google\Cloud\Storage\Connection $connection
리턴 Google\Cloud\Storage\Connection\ConnectionInterface