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: 16 441
Dependents: 4
Suggesters: 0
Security: 0
Stars: 12
Watchers: 5
Forks: 6
Open Issues: 22
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.15.0
- v1.14.0
- v1.13.0
- 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-release-please--branches--main--components--momentohq/client-sdk-php
- dev-read-concern
- dev-feat/github-workflow
- dev-dependabot/composer/examples/momentohq/client-sdk-php-1.12.0
- dev-feat/topic-poc
- dev-php-benchmark
This package is auto-updated.
Last update: 2024-11-05 01:10:40 UTC
README
Momento Client Library for PHP
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 client library for PHP.
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
- Momento SDK Documentation for PHP: https://docs.momentohq.com/sdks/php
- Discuss: Momento Discord
Japanese: 日本語
Packages
The Momento SDK for PHP 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.
Attributions
This product includes PHP software, freely available from http://www.php.net/software/
For more info, visit our website at https://gomomento.com!