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.
Japanese: 日本語
The Momento SDK for PHP 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.
This product includes PHP software, freely available from http://www.php.net/software/
For more info, visit our website at https://gomomento.com!