momentohq / client-sdk-php
Momento PHP SDK,用于Momento,一个无需传统缓存解决方案所需任何运营开销的自动扩展的无服务器缓存。
v1.12.0
2024-09-25 19:12 UTC
Requires
- php: >=7.4
- ext-grpc: *
- ext-protobuf: *
- firebase/php-jwt: ^6.3
- grpc/grpc: 1.57.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- psr/simple-cache: ^1.0.1 || ^3.0
Requires (Dev)
- composer/composer: ^2.4.1
- friendsofphp/php-cs-fixer: 3.64.0
- phpunit/phpunit: ^9.5.23
- dev-main
- v1.12.0
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.0
- v0.7.1
- v0.7.0
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.2
- v0.2.1
- v0.2.0
- 0.1.0
- dev-dependabot/composer/examples/momentohq/client-sdk-php-1.12.0
- dev-release-please--branches--main--components--momentohq/client-sdk-php
- dev-php-83-84
- dev-set-contains-elements
- dev-test_auth_token
- dev-release
- dev-deprecate-set-if-not-exists
- dev-add-cas-ops
- dev-update-protos
- dev-support-fractional-ttl
- dev-docs-cleanup
- dev-fix/update-dockerfile
- dev-chore/updateGrpc
- dev-chore/nogrpc2
- dev-chore/removegrpcdep
- dev-feat/add-getBatch-and-setBatch
- dev-fix-psr16
- dev-feat/topic-poc
- dev-test-testing
- dev-add-close-method-for-client
- dev-add-flush-cache
- dev-test-matrix
- dev-drupal-psr-log-version
- dev-bp-error-tracing
- dev-bp-error-tracing2
- dev-patch-2
- dev-async-get
- dev-chore/update-jp-readme
- dev-grpc-fork-test
- dev-NoSQLKnowHow-patch-1
- dev-update-readmes-0-6-2
- dev-fix-examples-0-6-2
- dev-add-retries
- dev-fix-deprecation-warning
- dev-update-composer-for-packagist
- dev-chore/upgrade-sdk-version
- dev-chore/update-cred-provider
- dev-validation-fixes
- dev-cache-client-rename
- dev-rename-simple-cache-client
- dev-remove-collections-warning
- dev-php-loadgen
- dev-remove-list-earse
- dev-php-benchmark
- dev-disclaimer-about-preview-collection-apis
- dev-remove-collection-specific-delete
- dev-make-docker-more-general-purpose
- dev-chore/refresh-ttl-optional
- dev-fix-dict-miss-test
- dev-fix-cred-provider-test-class-name
- dev-logger-factory
- dev-proxy-followup
- dev-chore/add-set-delete
- dev-proxy-support
- dev-chore/dictionary-get-batch-return-array
- dev-chore/add-set-remove-element
- dev-chore/update-dictionary-set-names
- dev-chore/update-value-properties
- dev-add-configuration-class
- dev-psr16-library
- dev-fixing-php-ci-version
- dev-chore/dockerize-php-test
- dev-push-to-release-fix
- dev-feat/add-set-add
- dev-update-php-examples-to-0.2.0
- dev-use-strict-types
- dev-use-firebase-jwt
- dev-to-string-additions-and-fixes
- dev-release-workflow
- dev-fix-deadline-calculation
- dev-dict-increment-and-remove
- dev-chore/add-dictionary-fetch-getbatch-setbatch
- dev-chore/add-ads-example
- dev-chore/add-dictionary-set-get-delete
- dev-dict-rebased
- dev-add-list-api-continued
- dev-add-list-api
- dev-convert-error-responses
- dev-chore/add-jp-readme
- dev-machine-user-for-readme
- dev-fix-readme-generation-on-push
- dev-add-readme-template
- dev-add-auth-provider
- dev-fix/add-github-actions
- dev-fix/tests-and-fixes
- dev-fix/consolidate-error-classes
- dev-fix/move-example-script-to-directory
- dev-feat/wip
- dev-dev-main
This package is auto-updated.
Last update: 2024-09-26 02:27:48 UTC
README
Momento PHP 客户端库
Momento 缓存是一个快速、简单、按使用付费的缓存解决方案,无需传统缓存解决方案所需的任何运营开销。此存储库包含 Momento PHP 客户端库的源代码。
要开始使用 Momento,您需要一个 Momento 认证令牌。您可以从 Momento 控制台 获取一个。
- 网站: https://www.gomomento.com/
- Momento 文档: https://docs.momentohq.com/
- 入门: https://docs.momentohq.com/getting-started
- PHP SDK 文档: https://docs.momentohq.com/sdks/php
- 讨论: Momento Discord
日语: 日本語
包
Momento PHP SDK 包可在 packagist.org 上找到: client-sdk-php
使用方法
<?php require "vendor/autoload.php"; use Momento\Auth\CredentialProvider; use Momento\Cache\CacheClient; use Momento\Config\Configurations\Laptop; $client = new CacheClient( Laptop::latest(), CredentialProvider::fromEnvironmentVariable("MOMENTO_API_KEY"), 60 ); $client->createCache("cache"); $client->set("cache", "myKey", "myValue"); $response = $client->get("cache", "myKey"); if ($hit = $response->asHit()) { print("Got value: {$hit->valueString()}\n"); }
入门和文档
要开始使用 Momento,您需要一个 Momento API 密钥。您可以从 Momento 控制台 获取一个。
文档可在 Momento 文档网站 上找到。
示例
包含所有必需构建配置文件的运行示例项目可在 示例目录 中找到。
开发
如果您有兴趣为 SDK 贡献,请参阅 CONTRIBUTING 文档。
更多信息,请访问我们的网站 https://gomomento.com!