GithubHelp home page GithubHelp logo

laminas-cache-storage-adapter-memcached's Introduction

laminas-cache-storage-adapter-memcached

Build Status type-coverage Psalm level

🇷🇺 Русским гражданам

Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.

У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.

Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"

🇺🇸 To Citizens of Russia

We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.

One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.

You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

This library provides a laminas-cache compatible StorageInterface implementation for Memcached.

Installation

Run the following to install this library:

$ composer require laminas/laminas-cache-storage-adapter-memcached

Documentation

Browse the documentation online at https://docs.laminas.dev/laminas-cache-storage-adapter-memcached/

Support

laminas-cache-storage-adapter-memcached's People

Contributors

akrabat avatar allovince avatar binarykitten avatar boesing avatar chadicus avatar eremaijala avatar ezimuel avatar ghostwriter avatar gsteel avatar kokspflanze avatar koopzington avatar laminas-bot avatar maks3w avatar marc-mabe avatar michalbundyra avatar micheh avatar neeckeloo avatar ocramius avatar panvid avatar phpgangsta avatar prolic avatar renovate[bot] avatar samsonasik avatar slamdunk avatar stefanotorresi avatar tdutrion avatar thomasvargiu avatar tysonandre avatar weierophinney avatar xerkus avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laminas-cache-storage-adapter-memcached's Issues

Psalm integration

Feature Request

Q A
QA yes

Summary

As decided during the Technical-Steering-Committee Meeting on August 3rd, 2020, Laminas wants to implement vimeo/psalm in all packages.

Implementing psalm is quite easy.

Required

  • Create a .psalm.xml.dist in the project root
  • Copy and paste the contents from this psalm.xml.dist
  • Run $ composer require vimeo/psalm
  • Run $ vendor/bin/psalm --set-baseline=psalm-baseline.xml
  • Add a composer script static-analysis with the command psalm --shepherd --stats
  • Add a new line to script: in .travis.yml: - if [[ $TEST_COVERAGE == 'true' ]]; then composer static-analysis ; fi
  • Remove phpstan from the project (phpstan.neon.dist, .travis.yml entry, composer.json require-dev and scripts)
Optional
  • Fix as many psalm errors as possible.

Add PHP 8.1 support

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

Add support for the newly released PHP 8.1

PHP 8.0 support

Feature Request

Q A
New Feature yes

Summary

To be prepared for the december release of PHP 8.0, this repository has some additional TODOs to be tested against the new major version.

In order to make this repository compatible, one has to follow these steps:

  • Modify composer.json to provide support for PHP 8.0 by adding the constraint ~8.0.0
  • Modify composer.json to drop support for PHP less than 7.3
  • Modify composer.json to implement phpunit 9.3 which supports PHP 7.3+
  • Modify .travis.yml to ignore platform requirements when installing composer dependencies (simply add --ignore-platform-reqs to COMPOSER_ARGS env variable)
  • Modify .travis.yml to add PHP 8.0 to the matrix (NOTE: Do not allow failures as PHP 8.0 has a feature freeze since 2020-08-04!)
  • Modify source code in case there are incompatibilities with PHP 8.0

Cannot get value when value is set to `value`

Bug Report

We noticed recently that setting a memcached value of string value returns NULL instead of the expected string value.

Q A
Version(s) 1.0.1

Summary

One of our unit tests started failing. We eventually realized that it was because we were testing with a memcached value of string value. Once we updated our unit tests to test with any other string, such as val or 12345, the unit tests started working again.

Current behavior

When setting a memcached value to value and then trying to get this value later, this returned value is NULL instead of value.

How to reproduce

use Laminas\Cache\Storage\Adapter\Memcached as LaminasMemcached;
use Laminas\Cache\Storage\Adapter\MemcachedOptions as LaminasMemcachedOptions;
use Laminas\Cache\Storage\Adapter\MemcachedResourceManager as LaminasMemcachedResourceManager;

$laminasMemcachedResourceManager = new LaminasMemcachedResourceManager();
$laminasMemcachedResourceManager->addServer('default', 'localhost');

$laminasMemcachedOptions = new LaminasMemcachedOptions();
$laminasMemcachedOptions->setResourceManager($laminasMemcachedResourceManager);

$laminasMemcached = new LaminasMemcached($laminasMemcachedOptions);

$laminasMemcached->setItem('foo', 'value');
var_dump($laminasMemcached->getItem('foo'));

The above code dumps NULL.

Interestingly, if the value is set to something other than value, then the code executes as expected.

Expected behavior

The above code should dump string(5) "value"

`Memcached#decrement` results in a client error when decrementing a value to unsigned integer

Bug Report

Q A
Version(s) latest
ext-memcached 3.1.5
Memcached 1.6.10

Summary

When calling Memcached#decrement twice with the same key, it returns false and the status code 9 which translates to the RES_CLIENT_ERROR constant.

When Memcached#getLastErrorMessage is called, we get more details on this:

(0x7ff922d5da40) cannot increment or decrement non-numeric value

Current behavior

  • First call to Memcached#decrement creates and decrements the key.
  • Second call returns false while not touching the key at all (it remains on the initial value)

How to reproduce

$memcached = new Memcached(); // set options to point to the appropriate memcached server instance
$memcached->decrementItem('foo', 1);
$memcached->decrementItem('foo', 1);

assert($memcached->getItem('foo') === -2);

Expected behavior

Assertion works.

The maximum key length provided by the capabilities is invalid

Bug Report

Q A
Version(s) 1.1.0

Summary

The storage adapter states that its maximum key length is 255.
As per the source code of memcached, the maximum key length is 250. Thats how it is since 15 years.

memcached/memcached@217dcce#diff-e471fd56f09dcb25f96a32a2645c4511b65a12fb4cda7fced63d379789050f76R660

Current behavior

Capabilities state that the maximum key length is 255.

How to reproduce

Store a value with a cache key > 250

Expected behavior

When using along with the SimpleCacheDecorator, an InvalidArgumentException has to be thrown when a key is used > than the maximum key length stated by the adapter.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Detected dependencies

composer
composer.json
  • php ~8.1.0 || ~8.2.0 || ~8.3.0
  • laminas/laminas-cache ^4.0
  • laminas/laminas-cache-storage-adapter-benchmark ^2.0
  • laminas/laminas-cache-storage-adapter-test ^4.0
  • laminas/laminas-coding-standard ~2.5.0
  • phpunit/phpunit ^10.5
  • psalm/plugin-phpunit ^0.18.0
  • vimeo/psalm ^5.18
github-actions
.github/workflows/continuous-integration.yml
  • laminas/laminas-ci-matrix-action v1
  • laminas/laminas-continuous-integration-action v1
  • memcached 1.6-alpine
.github/workflows/release-on-milestone-closed.yml

  • Check this box to trigger a request for Renovate to run again on this repository

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.