google / cloud-storage
PHP的云存储客户端
v1.42.1
2024-07-08 23:14 UTC
Requires
- php: ^8.0
- google/cloud-core: ^1.55
- ramsey/uuid: ^4.2.3
Requires (Dev)
- erusev/parsedown: ^1.6
- google/cloud-pubsub: ^2.0
- phpdocumentor/reflection: ^5.3.3
- 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.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-09-08 23:41:05 UTC
README
PHP风格的云存储客户端。
注意:该仓库是Google Cloud PHP的一部分。有关支持请求、错误报告或开发贡献,请将该项目指向该项目。
允许全球存储和检索任何时间的数据。您可以使用云存储来满足各种场景,包括提供网站内容、存储归档和灾难恢复数据,或通过直接下载向用户分发大型数据对象。
安装
首先,安装PHP首选的依赖管理器Composer。
现在安装此组件
$ composer require google/cloud-storage
身份验证
有关客户端身份验证的更多信息,请参阅我们的身份验证指南。一旦完成身份验证,您就可以开始发起请求。
示例
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');
流包装器
require 'vendor/autoload.php'; use Google\Cloud\Storage\StorageClient; $storage = new StorageClient(); $storage->registerStreamWrapper(); $contents = file_get_contents('gs://my_bucket/file_backup.txt');
版本
此组件被认为是GA(通用可用)。因此,它不会在任何次要或修补版本中引入不兼容的更改。我们将优先处理问题和请求。