google / cloud-memcache
Memcached 客户端 PHP 内存存储库
v2.0.0
2024-09-07 00:21 UTC
Requires
- php: ^8.0
- google/gax: ^1.34.0
Requires (Dev)
- phpunit/phpunit: ^9.0
Suggests
- ext-grpc: Enables use of gRPC, a universal high-performance RPC framework created by Google.
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
This package is auto-updated.
Last update: 2024-09-07 01:43:19 UTC
README
这是一个针对 Memorystore for Memcached 的 PHP 语言的 idiomatic 客户端。
注意: 此存储库是 Google Cloud PHP 的一部分。有关支持请求、错误报告或开发贡献的任何问题,请直接联系该项目。
安装
首先,安装 PHP 推荐的依赖关系管理器 Composer。
现在安装此组件
$ composer require google/cloud-memcache
此组件支持通过 HTTP/1.1 的 REST 和 gRPC。为了充分利用 gRPC 提供的好处(如流式方法),请参阅我们的 gRPC 安装指南。
身份验证
请参阅我们的 身份验证指南,了解更多关于身份验证客户端的信息。身份验证后,您就可以开始发送请求了。
示例
require 'vendor/autoload.php'; use Google\Cloud\Memcache\V1\CloudMemcacheClient; $client = new CloudMemcacheClient(); $location = CloudMemcacheClient::locationName('[MY_PROJECT_ID]', '-'); foreach ($client->listInstances($location) as $response) { foreach ($response->getResources() as $instance) { printf('Discovered instance: %s', $instance->getDisplayName()); } }
版本
此组件被认为是 GA(通用可用)。因此,在任何一个次要或补丁版本中都不会引入向后不兼容的更改。我们将优先处理问题和请求。
下一步
- 了解 官方文档。