Download the PHP package phpdot/redis without Composer

On this page you can find all versions of the php package phpdot/redis. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package redis

phpdot/redis

Coroutine-safe Redis client for PHP 8.4+. Wraps ext-redis \Redis with auto-reconnect, exponential backoff, exception translation, and a pool connector for phpdot/pool.

One RedisConnection owns one \Redis socket. Under Swoole, borrow a connection per coroutine through a pool so no two coroutines ever interleave commands on one socket — the same pattern phpdot/mongodb uses.


Table of Contents


Install

Requires PHP 8.4+, ext-redis ^6.0, and phpdot/contracts ^1.4.


Quick Start


Architecture


RedisConnection

RedisConfig

Lifecycle

Resilience

connect() retries up to maxRetries times with exponential backoff (100ms → 200ms → 400ms…). AUTH failures (NOAUTH, WRONGPASS) throw AuthenticationException immediately and are not retried. All other connection failures accumulate and throw ConnectionException once the retry budget is exhausted.


Coroutine Safety

ext-redis commands are blocking socket I/O. Two coroutines sharing one \Redis interleave request/reply bytes and corrupt each other — this is the footgun phpdot/redis-ql's own docs warn about.

phpdot/redis makes the safe pattern trivial: pool connections, borrow one per coroutine. Each pooled RedisConnection wraps exactly one \Redis; a coroutine borrows it, runs commands via getClient(), and returns it. No socket is ever shared across concurrent coroutines.


Connection Pooling

RedisConnector implements PHPdot\Contracts\Pool\ConnectorInterface, so phpdot/pool can hold and manage RedisConnection instances:

The connector depends only on phpdot/contractsphpdot/pool is not a runtime requirement, so the package stays usable in non-pooled runtimes (FPM, CLI one-shots).


Exception Handling

RedisException from ext-redis is caught and translated inside connect(); RedisConnection's own methods throw PHPdot\Redis\Exception\* types only.


Escape Hatch

getClient(): \Redis returns the underlying ext-redis instance for any command the wrapper does not surface. This is the primary consumer seam — phpdot/cache's RedisDriver, phpdot/session's RedisHandler, and phpdot/redis-ql's PhpRedisClient can all receive a pooled \Redis through it.


API Reference

RedisConfig API

Method Returns Notes
connectHost() string socket path or tls://-prefixed host
buildContext() ?array merged stream/SSL context, or null
getHostString() string socket path or host:port for errors

RedisConnection API

Method Returns Throws
connect() void ConnectionException, AuthenticationException
close() void never
isConnected() bool never
ping() bool never
ensureConnected() void ConnectionException
reconnect() void ConnectionException, AuthenticationException
getClient() \Redis ConnectionException
getConfig() RedisConfig never

RedisConnector API

Implements PHPdot\Contracts\Pool\ConnectorInterface.

Method Returns Notes
connect() object fresh connected RedisConnection
isAlive(object) bool type-guarded + ping()
close(object) void type-guarded, never throws

All versions of redis with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-redis Version ^6.0
phpdot/contracts Version ^1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpdot/redis contains the following files

Loading the files please wait ...