Download the PHP package drift/react-key-value without Composer

On this page you can find all versions of the php package drift/react-key-value. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package react-key-value

ReactPHP key-value cache

CircleCI

Just a simple key-value local cache for your ReactPHP projects

Set a key

You can set a value given a key in this cache. As simple as it sounds.

Define TTL

You can add a TTL for this key. After n seconds, this key will be automatically deleted.

Get a key

You can get a value from this cache by using the key. If the value is present inside the cache, this one will be returned with no transformations. Otherwise, null will be returned.

Refresh TTL on access

TTL can offer a proper way to basically clean elements that are almost not used. By defining a value in TTL, by default this key will be deleted after n seconds, no matter how many times this key has been requested until this moment. If we want to automatically refresh this TTL each time we access to a key, we can use this feature.

In this example, we can see that the key is defined with a TTL of 2 seconds and is requested each second, enabling the refreshTTL flag. In normal circumstances, after 2 seconds the get method should return null, but because we are forcing the cache to refresh this TTL when we access the key, as long as we don't have time gaps larger than 2 seconds, our key will always be available.

With this strategy you will only save locally these values used most frequent, finding this way a nice equilibrium between cache efficiency and storage size.

Delete a key

You can manually delete a key. If the key is not found inside the cache, nothing will happen.

Using the middleware

In your applications you might want to use this cache as a simple and thin middleware layer, so you can easily enable and disable without changing your domain implementation.

Well, then you should use the KeyValueCacheMiddleware class, acting as an uncoupled piece in the middle.

So, having this original code in PHP

You could easily add a simple layer that caches during 10 minutes, updating the key freshness each time this one es requested.


All versions of react-key-value with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
react/event-loop Version ^1.0 || ^0.5 || ^0.4 || ^0.3.5
react/promise Version ^2.7 || ^1.2.1
drift/react-functions Version ^0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package drift/react-key-value contains the following files

Loading the files please wait ....