All Projects → humanmade → wp-redis-predis-client

humanmade / wp-redis-predis-client

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

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to wp-redis-predis-client

phpRebloom
🎛️ Use RedisBloom in PHP!
Stars: ✭ 20 (+5.26%)
Mutual labels:  predis
Phpfastcache
A high-performance backend cache system. It is intended for use in speeding up dynamic web applications by alleviating database load. Well implemented, it can drops the database load to almost nothing, yielding faster page load times for users, better resource utilization. It is simple yet powerful.
Stars: ✭ 2,171 (+11326.32%)
Mutual labels:  predis
Predis
A flexible and feature-complete Redis client for PHP.
Stars: ✭ 6,966 (+36563.16%)
Mutual labels:  predis
phpRedisTimeSeries
📈 Use Redis Time Series in PHP!
Stars: ✭ 23 (+21.05%)
Mutual labels:  predis
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,
    ),
);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].