google / cloud-storage
Cloud Storage Client for PHP
Requires
- php: ^8.0
- google/cloud-core: ^1.57
- ramsey/uuid: ^4.2.3
Requires (Dev)
- erusev/parsedown: ^1.6
- google/cloud-pubsub: ^2.0
- phpdocumentor/reflection: ^5.3.3||^6.0
- phpdocumentor/reflection-docblock: ^5.3
- phpseclib/phpseclib: ^2.0||^3.0
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: 2.*
Suggests
- google/cloud-pubsub: May be used to register a topic to receive bucket notifications.
- phpseclib/phpseclib: May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2.
- dev-main
- v1.45.0
- v1.44.0
- v1.43.1
- v1.43.0
- v1.42.1
- v1.42.0
- v1.41.4
- v1.41.3
- v1.41.2
- v1.41.1
- v1.41.0
- v1.40.0
- v1.39.1
- v1.39.0
- v1.38.0
- v1.37.1
- v1.37.0
- v1.36.1
- v1.36.0
- v1.35.0
- v1.34.0
- v1.33.4
- v1.33.3
- v1.33.2
- v1.33.1
- v1.33.0
- v1.32.0
- v1.31.2
- v1.31.1
- v1.31.0
- v1.30.3
- v1.30.2
- v1.30.1
- v1.30.0
- v1.29.0
- v1.28.2
- v1.28.1
- v1.28.0
- v1.27.1
- v1.27.0
- v1.26.3
- v1.26.2
- v1.26.1
- v1.26.0
- v1.25.2
- v1.25.1
- v1.25.0
- v1.24.1
- v1.24.0
- v1.23.2
- v1.23.1
- v1.23.0
- v1.22.0
- v1.21.1
- v1.21.0
- v1.20.1
- v1.20.0
- v1.19.0
- v1.18.0
- v1.17.0
- v1.16.1
- v1.16.0
- v1.15.0
- v1.14.0
- v1.13.0
- v1.12.3
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.0
- v1.10.1
- v1.10.0
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- v0.1.0
This package is auto-updated.
Last update: 2024-12-12 23:19:02 UTC
README
Idiomatic PHP client for Cloud Storage.
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
Allows world-wide storage and retrieval of any amount of data at any time. You can use Cloud Storage for a range of scenarios including serving website content, storing data for archival and disaster recovery, or distributing large data objects to users via direct download.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/cloud-storage
Authentication
Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require 'vendor/autoload.php'; use Google\Cloud\Storage\StorageClient; $storage = new StorageClient(); $bucket = $storage->bucket('my_bucket'); // Upload a file to the bucket. $bucket->upload( fopen('/data/file.txt', 'r') ); // Using Predefined ACLs to manage object permissions, you may // upload a file and give read access to anyone with the URL. $bucket->upload( fopen('/data/file.txt', 'r'), [ 'predefinedAcl' => 'publicRead' ] ); // Download and store an object from the bucket locally. $object = $bucket->object('file_backup.txt'); $object->downloadToFile('/data/file_backup.txt');
Stream Wrapper
require 'vendor/autoload.php'; use Google\Cloud\Storage\StorageClient; $storage = new StorageClient(); $storage->registerStreamWrapper(); $contents = file_get_contents('gs://my_bucket/file_backup.txt');
Debugging
Please see our Debugging guide for more information about the debugging tools.
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.
Next Steps
- Understand the official documentation.
- Take a look at in-depth usage samples.