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: 日本語
The Momento PHP SDK package is available on 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");
}
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.
Working example projects, with all required build configuration files, are available in the examples directory.
If you are interested in contributing to the SDK, please see the CONTRIBUTING docs.
For more info, visit our website at https://gomomento.com!