Giter VIP home page Giter VIP logo

wmcontroller_redis's Introduction

wmcontroller_redis

Latest Stable Version Total Downloads License

A Redis cache storage for wieni/wmcontroller

Installation

This package requires PHP 8.0, PhpRedis and Drupal 9.1 or higher. It can be installed using Composer:

 composer require wieni/wmcontroller_redis

To enable this cache storage, change the wmcontroller.cache.storage and wmcontroller.cache.invalidator container parameter:

parameters:
    wmcontroller.cache.storage: wmcontroller.cache.storage.redis
    wmcontroller.cache.invalidator: wmcontroller.redis.checksum

    wmcontroller.cache.redis.prefix: 'wmcontroller:'

Make sure to also set the host & base in settings.php.

$settings['wmcontroller.redis.connection']['host'] = '127.0.0.1';
$settings['wmcontroller.redis.connection']['base'] = '0';

Run drush wmcontroller_redis:mark-expired nightly to search for stale entries and mark them for deletion.

Changelog

All notable changes to this project will be documented in the CHANGELOG file.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

Distributed under the MIT License. See the LICENSE file for more information.

wmcontroller_redis's People

Contributors

akasake avatar dieterholvoet avatar robinhoutevelts avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

drupallabs

wmcontroller_redis's Issues

Clean up module

  • Cleanup code using wieni/wmcodestyle
  • Normalise composer.json
  • Add LICENSE in case it's missing. Also add the license to composer.json.
  • Add CHANGELOG.md (and UPGRADING.md, if applicable)
  • Add issue & pull request templates
  • Update repo description & tags
  • Update README
  • Update .gitignore
  • Check dependencies: ensure composer.json has a php & drupal/core version requirements and add missing requirements to the .info file

ArgumentCountError: Wrong parameter count for Redis::sAdd() in RedisStorage.php

Description

When RedisStorage::set(Cache $item, array $tags) is called with an empty $tags array we get an ArgumentCountError error. This only happens on phpredis >= 6.0.0

Proposed Solution

This is where we invoke the sAdd method. We should wrap it in an if-statement.

$tx->del($this->prefix($id, 'tags'));
$tx->sAdd(
$this->prefix($id, 'tags'),
...$tags
);
$tx->sRem($this->prefix('stale'), $id);

Update wmcodestyle

  • Add phpstan.neon config file referencing the wmcodestyle rule files (example)
  • Add phpstan analyse to the coding-standards composer script
  • Add autoload-dev entry to ensure autoloading during analysis

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.