momentohq / client-sdk-php
PHP SDK for Momento, a serverless cache that automatically scales without any of the operational overhead required by traditional caching solutions.
Installs: 15 700
Dependents: 3
Suggesters: 0
Security: 0
Stars: 12
Watchers: 4
Forks: 5
Open Issues: 25
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-feat/add-ttl
- dev-release-please--branches--main--components--momentohq/client-sdk-php
- dev-feat/add-ttl-apis
- dev-dependabot/composer/examples/momentohq/client-sdk-php-1.12.0
- 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-10-11 23:08:39 UTC
README
Momento PHP Client Library
Momento Cache is a fast, simple, pay-as-you-go caching solution without any of the operational overhead required by traditional caching solutions. This repo contains the source code for the Momento PHP client library.
To get started with Momento you will need a Momento Auth Token. You can get one from the Momento Console.
- Website: https://www.gomomento.com/
- Momento Documentation: https://docs.momentohq.com/
- Getting Started: https://docs.momentohq.com/getting-started
- PHP SDK Documentation: https://docs.momentohq.com/sdks/php
- Discuss: Momento Discord
Japanese: 日本語
Packages
The Momento PHP SDK package is available on packagist.org: client-sdk-php
Usage
<?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"); }
Getting Started and Documentation
To get started with Momento you will need a Momento API key. You can get one from the Momento Console.
Documentation is available on the Momento Docs website.
Examples
Working example projects, with all required build configuration files, are available in the examples directory.
Developing
If you are interested in contributing to the SDK, please see the CONTRIBUTING docs.
For more info, visit our website at https://gomomento.com!