Coder Social home page Coder Social logo

php-react-cache-memcached's Introduction

Memcached cache implementation for react/cache

Build Status

Implementation of react/cache interface that uses Memcached as a storage.

Table of Contents

Installation

Library requires PHP 7.2.0 or above.

The recommended way to install this library is via Composer. New to Composer?

See also the CHANGELOG for details about version upgrades.

composer require seregazhuk/react-cache-memcached

Quick Start

React\Cache\CacheInterface has three simple methods to store, retrieve and remove data:

use React\EventLoop\Factory;
use seregazhuk\React\Cache\Memcached\Memcached;

$loop = Factory::create();
$cache = new Memcached($loop);

// store
$cache->set('key', 12345);

// store for a minute
$cache->set('key', 12345, 60);

// retrieve
$cache->get('key')->then(function($value){
    // handle data
});

// ...

// delete
$cache->delete('key');

$loop->run();

php-react-cache-memcached's People

Contributors

seregazhuk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

php-react-cache-memcached's Issues

react/cache v1.x compatibility

Hello! Is there any plan to update this library to use react/cache ^1.0?

It seems not working right now since it does not implement the PSR-16 compatible methods;

PHP Fatal error:  Class seregazhuk\React\Cache\Memcached\Memcached contains 5 abstract methods and must therefore be declared abstract or implement the remaining methods (React\Cache\CacheInterface::getMultiple, React\Cache\CacheInterface::setMultiple, React\Cache\CacheInterface::deleteMultiple, ...) in /home/runner/work/DiscordPHP/DiscordPHP/vendor/seregazhuk/react-cache-memcached/src/Memcached.php on line 10

I'm currently working on PHP 7.4 - 8.1, planning to use it on a library that'd provides react/cache options either redis or memcached (this)

Some other dependency requirements if possible:

Using version ^1.0 for seregazhuk/react-cache-memcached
./composer.json has been updated
Running composer update seregazhuk/react-cache-memcached
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - seregazhuk/react-cache-memcached 1.0.2 requires seregazhuk/react-memcached ^0.2 -> satisfiable by seregazhuk/react-memcached[v0.2.0, 0.2.1].
    - seregazhuk/react-cache-memcached[v1.0.0, ..., v1.0.1] require react/cache ^0.4.1 -> found react/cache[v0.4.1, v0.4.2] but it conflicts with your root composer.json require (^1.1).
    - seregazhuk/react-memcached v0.2.0 requires react/socket ^0.8 -> found react/socket[v0.8.0, ..., v0.8.12] but the package is fixed to v1.11.0 (lock file 
version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - seregazhuk/react-memcached 0.2.1 requires evenement/evenement 3 -> found evenement/evenement[3.0.0] but the package is fixed to v3.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires seregazhuk/react-cache-memcached ^1.0 -> satisfiable by seregazhuk/react-cache-memcached[v1.0.0, v1.0.1, 1.0.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require seregazhuk/react-cache-memcached:*" to figure out if 
any version is installable, or "composer require seregazhuk/react-cache-memcached:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.