PHPackages                             jobverplanke/craftcms-components - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. jobverplanke/craftcms-components

ActiveLibrary[Queues &amp; Workers](/categories/queues)

jobverplanke/craftcms-components
================================

Simple driver setup for CraftCMS components queue, cache or session

v0.5.0(1y ago)0366MITPHPPHP ^8.2

Since Oct 18Pushed 1y ago2 watchersCompare

[ Source](https://github.com/jobverplanke/craftcms-components)[ Packagist](https://packagist.org/packages/jobverplanke/craftcms-components)[ RSS](/packages/jobverplanke-craftcms-components/feed)WikiDiscussions 0.x Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

Introduction
------------

[](#introduction)

Simple driver setup for CraftCMS components queue, cache or session for CraftCMS v4 and v5.

Available components and drivers

RedisDatabase**Cache**✅✅**Queue**✅❌ (default driver)**Session**✅✅Note

Craft's default queue driver is the database. Do not configure the queue component in the app.php if you want to make use of the database queue driver.

Craft v4:
Craft v5:

Installation
------------

[](#installation)

```
composer require jobverplanke/craftcms-components
```

Make sure that the `yiisoft/yii2-redis` package is installed when utilizing Redis

```
composer require yiisoft/yii2-redis
```

Configuration
-------------

[](#configuration)

To make use of a different driver per component is a breeze. Just specify the desired driver for the component you want to use in the `components` config array in either `config/app.php` or `config/app.web.php` (session only).

### Database configuration

[](#database-configuration)

In order to use the `database` driver, configure CraftCMS as followed

### Cache component

[](#cache-component)

```
// .env
CRAFT_CACHE_DRIVER=database

// config/app.php

use craft\helpers\App;
use Verplanke\CraftComponents\Components\Cache;

return [
    'components' => [
        'cache' => fn () => Cache::driver(App::env('CRAFT_CACHE_DRIVER')),
    ],
];
```

### Queue component

[](#queue-component)

```
// .env
CRAFT_QUEUE_DRIVER=database

// config/app.php

use craft\helpers\App;
use Verplanke\CraftComponents\Components\Queue;

return [
    'components' => [
        'queue' => Queue::driver(App::env('CRAFT_QUEUE_DRIVER')),
    ],
];
```

### Session component

[](#session-component)

```
// .env
CRAFT_SESSION_DRIVER=database

// config/app.web.php

use craft\helpers\App;
use Verplanke\CraftComponents\Components\Session;

return [
    'components' => [
        'session' => fn () => Session::driver(App::env('CRAFT_SESSION_DRIVER')),
    ],
];
```

### Redis configuration

[](#redis-configuration)

If you want to use the `Redis` driver for a specific component, make sure Redis is configured

1. Add the Redis component to the `app.php`, see example below
2. Enable Redis by adding the following environment variables
    - `REDIS_URL=` OR `REDIS_HOST`, `REDIS_PORT` and `REDIS_PASSWORD`

Note

`REDIS_URL` takes precedence over `REDIS_HOST`, `REDIS_PORT` and `REDIS_PASSWORD`.

```
// config/app.php

use Verplanke\CraftComponents\Components\Redis;

return [
    'components' => [
        'redis' => Redis::connect(),
    ],
];
```

### Cache component

[](#cache-component-1)

```
// .env
CRAFT_CACHE_DRIVER=redis

// config/app.php

use craft\helpers\App;
use Verplanke\CraftComponents\Components\Cache;

return [
    'components' => [
        'cache' => fn () => Cache::driver(App::env('CRAFT_CACHE_DRIVER')),
    ],
];
```

### Queue component

[](#queue-component-1)

```
// .env
CRAFT_QUEUE_DRIVER=redis

// config/app.php

use craft\helpers\App;
use Verplanke\CraftComponents\Components\Queue;

return [
    'components' => [
        'queue' => Queue::driver(App::env('CRAFT_QUEUE_DRIVER')),
    ],
];
```

### Session component

[](#session-component-1)

```
// .env
CRAFT_SESSION_DRIVER=redis

// config/app.web.php

use craft\helpers\App;
use Verplanke\CraftComponents\Components\Session;

return [
    'components' => [
        'session' => fn () => Session::driver(App::env('CRAFT_SESSION_DRIVER')),
    ],
];
```

### Environment Variable Configuration

[](#environment-variable-configuration)

The following environment variables are available for further configuration of the components
It's recommended to leave the following set to `false` when using Heroku. [Heroku issue](https://help.heroku.com/HC0F8CUS/redis-connection-issues) and [Github issue](https://github.com/phpredis/phpredis/issues/1941)

- `REDIS_SSL`
- `REDIS_SSL_VERIFY_PEER`
- `REDIS_SSL_VERIFY_PEER_NAME`

RequiredTypeDefault ValueDescription / Remark`CRAFT_CACHE_DRIVER`✅stringPossible values `redis` or `database``CRAFT_SESSION_DRIVER`✅stringPossible values `redis` or `database``CRAFT_QUEUE_DRIVER`✅stringPossible values `redis` or `database``REDIS_URL`✅stringTakes precedence over `REDIS_HOST`, `REDIS_PORT` and `REDIS_PASSWORD`.`REDIS_HOST`string**Only when `REDIS_URL` is not used**`REDIS_PORT`string6379**Only when `REDIS_URL` is not used**`REDIS_PASSWORD`string**Only when `REDIS_URL` is not used**`REDIS_DB`integer0Default database to use, this database will be used for all Redis connections`REDIS_RETRIES`integer1Th..ount of times to retry connecting after connection has timed out`REDIS_SSL`booleanfalseUse SSL connection when connecting with Redis. Recommended to use `false` when using Heroku`REDIS_SSL_VERIFY_PEER`booleanfalseVerify peer SSL certificate. Recommended to use `false` when using Heroku`REDIS_SSL_VERIFY_PEER_NAME`booleanfalseVerify peer name of SSL certificate. Recommended to use `false` when using Heroku`REDIS_CACHE_DB`integer1Which database to use for the cache database. Make sure the cache database is separated from the queue and session database`REDIS_QUEUE_DB`integer3Which database to use for the queue database`REDIS_QUEUE_CHANNEL`stringqueueQueue channel to use`REDIS_QUEUE_TTR`integer300Max time for job execution, unit in seconds`REDIS_QUEUE_ATTEMPTS`integer3Max number of attempts`REDIS_SESSION_DB`integer1Which database to use for the session database.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

7

Last Release

553d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6efb188b3d3e770fc23719f3d7f93d3d0d6b0970ea42982310479122dd3617bc?d=identicon)[jobverplanke](/maintainers/jobverplanke)

---

Top Contributors

[![jobverplanke](https://avatars.githubusercontent.com/u/18289961?v=4)](https://github.com/jobverplanke "jobverplanke (9 commits)")

### Embed Badge

![Health badge](/badges/jobverplanke-craftcms-components/health.svg)

```
[![Health](https://phpackages.com/badges/jobverplanke-craftcms-components/health.svg)](https://phpackages.com/packages/jobverplanke-craftcms-components)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[react/async

Async utilities and fibers for ReactPHP

2228.8M171](/packages/react-async)[react/promise-stream

The missing link between Promise-land and Stream-land for ReactPHP

11512.9M45](/packages/react-promise-stream)[illuminate/bus

The Illuminate Bus package.

6043.8M409](/packages/illuminate-bus)[google/cloud-pubsub

Cloud PubSub Client for PHP

9017.1M63](/packages/google-cloud-pubsub)[ostark/craft-async-queue

A queue handler that moves queue execution to a non-blocking background process

95288.6k9](/packages/ostark-craft-async-queue)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
