GithubHelp home page GithubHelp logo

isabella232 / wp-redis-predis-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from humanmade/wp-redis-predis-client

0.0 0.0 0.0 81 KB

An alternative Redis client for use with WP Redis. Enables TLS connections.

PHP 87.91% Shell 12.09%

wp-redis-predis-client's Introduction

WP Redis - Predis Client
An alternative Redis client for use with WP Redis. Enables TLS connections.
Build status Codecov
A Human Made project. Maintained by @nathanielks.

WP Redis - Predis Client

This is a package that enables the use of Predis as a Redis Client as opposed to PHPRedis for WP Redis. Predis has the distinct advantage of connecting to Redis via TLS, encrypting traffic in-transit. Requires WP Redis >= 0.7.0.

Getting Started

Requiring Files

Composer

When using Composer, functions.php file will automatically be loaded whenever you include Composer's autoloader in your project.

Manually Requiring

The only file needing require_onceing for WP Predis to work correctly is functions.php (which is automatically included via vendor/autoload.php, which is generated by Composer). Download this repo somewhere in your project, run composer install, and include vendor/autoload.php somewhere early (such as wp-config.php):

require_once '/path/to/wp-redis-predis-client/vendor/autoload.php';

Object Cache stub

Now that files have been included, it's recommended you use the included object-cache.php file instead of the one included with WP Redis. It will add the required filters for WP Predis to work and then include WP Redis' object-cache.php file. Once object-cache.php is in wp-content (or whatever content directory you are using), you're good to go!

Configuring Predis

WP Redis - Predis Client adheres to WP Redis' configuration details. Predis also takes an additional argument, ssl, for configuring TLS connections. See PHP's SSL Context options for more details.

global $redis_server;
$redis_server = array(
    'host' => '127.0.0.1',
    'port' => 6379,
    'ssl'  => array(
        'local_cert' => '/path/to/certificate_and_key.pem',
        'verify_peer' => true,
    ),
);

wp-redis-predis-client's People

Contributors

nathanielks avatar roborourke avatar jazzsequence avatar joehoyle avatar danielbachhuber avatar tangrufus avatar

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.