PHPackages                             dotkernel/dot-cache - 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. [Database &amp; ORM](/categories/database)
4. /
5. dotkernel/dot-cache

ActiveLibrary[Database &amp; ORM](/categories/database)

dotkernel/dot-cache
===================

Dotkernel cache component extending symfony-cache

4.4.0(6mo ago)329.7k↑63.2%2[1 issues](https://github.com/dotkernel/dot-cache/issues)3MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Mar 8Pushed 6mo agoCompare

[ Source](https://github.com/dotkernel/dot-cache)[ Packagist](https://packagist.org/packages/dotkernel/dot-cache)[ RSS](/packages/dotkernel-dot-cache/feed)WikiDiscussions 4.0 Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (21)Used By (3)

dot-cache
=========

[](#dot-cache)

Dotkernel cache component based on symfony-cache.

> dot-cache is a wrapper on top of [symfony/cache](https://github.com/symfony/cache)

Documentation
-------------

[](#documentation)

Documentation is available at: .

Badges
------

[](#badges)

[![OSS Lifecycle](https://camo.githubusercontent.com/414aeca220d2dee9aaa5d1b2381fe116698e0be9a8d14379aad8b635b2a91805/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d6361636865)](https://camo.githubusercontent.com/414aeca220d2dee9aaa5d1b2381fe116698e0be9a8d14379aad8b635b2a91805/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d6361636865)[![PHP from Packagist (specify version)](https://camo.githubusercontent.com/7fc7a45c52e80a492f94439ad03b01b1e860caa4e301f5e961b97fc42b87d258/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d63616368652f342e342e30)](https://camo.githubusercontent.com/7fc7a45c52e80a492f94439ad03b01b1e860caa4e301f5e961b97fc42b87d258/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d63616368652f342e342e30)

[![GitHub issues](https://camo.githubusercontent.com/d50855e804313a484772def1a41b38bf7936bdadc7b4ae21468b1372db9d9476/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f646f746b65726e656c2f646f742d6361636865)](https://github.com/dotkernel/dot-cache/issues)[![GitHub forks](https://camo.githubusercontent.com/2e2d4c58e14a932f71ea6d012787819f5a754da0bc1a8c7d5f67d06fbf720a04/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f646f746b65726e656c2f646f742d6361636865)](https://github.com/dotkernel/dot-cache/network)[![GitHub stars](https://camo.githubusercontent.com/681acc49d040f8479a35a5f17ef518eb88cd786d0c8e30b2e6140d892087ea20/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f646f746b65726e656c2f646f742d6361636865)](https://github.com/dotkernel/dot-cache/stargazers)[![GitHub license](https://camo.githubusercontent.com/ecfd4f98a1f53d09e07b84dd6a4aefb6996f591ff5c932267d56e4541b7c951e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f746b65726e656c2f646f742d6361636865)](https://github.com/dotkernel/dot-cache/blob/4.0/LICENSE.md)

[![Build Static](https://github.com/dotkernel/dot-cache/actions/workflows/continuous-integration.yml/badge.svg?branch=4.0)](https://github.com/dotkernel/dot-cache/actions/workflows/continuous-integration.yml)[![codecov](https://camo.githubusercontent.com/4e2067fd0bb1dc8f3b09d332575402f632bb2a62620b99c5a0e32fc0484cc0e0/68747470733a2f2f636f6465636f762e696f2f67682f646f746b65726e656c2f646f742d63616368652f67726170682f62616467652e7376673f746f6b656e3d46414e314d584b4b5339)](https://codecov.io/gh/dotkernel/dot-cache)[![PHPStan](https://github.com/dotkernel/dot-cache/actions/workflows/static-analysis.yml/badge.svg?branch=4.0)](https://github.com/dotkernel/dot-cache/actions/workflows/static-analysis.yml)

> This package supports only `array` and `filesystem` adapters, you can use multiple adapters at once.

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

[](#installation)

Run the following command in your project directory

```
composer require dotkernel/dot-cache
```

After installing, add the `Dot\Cache\ConfigProvider::class` class to your configuration aggregate.

Configuration for Doctrine in\_array
------------------------------------

[](#configuration-for-doctrine-in_array)

In `config\autoload\doctrine.global.php` you need to add the following configurations:

Under the `doctrine.configuration.orm_default` key add the following config:

```
'result_cache'       => 'array',
'metadata_cache'     => 'array',
'query_cache'        => 'array',
'hydration_cache'    => 'array',
'second_level_cache' => [
    'enabled'                    => true,
    'default_lifetime'           => 3600,
    'default_lock_lifetime'      => 60,
    'file_lock_region_directory' => '',
    'regions'                    => [],
],
```

Next, under the `doctrine` key add the following config:

```
'cache' => [
    'array' => [
        'class' => \Dot\Cache\Adapter\ArrayAdapter::class,
    ],
],
```

> The above configuration will use an in-memory cache, because you use the `array` adapter.

If you want to store the cache into files on your local disk, you will need to use the `filesystem` adapter.

Configuration for Doctrine cache using filesystem
-------------------------------------------------

[](#configuration-for-doctrine-cache-using-filesystem)

**The `filesystem` adapter needs some extra configurations:**

- directory (folder path)
- namespace (directory name)

```
'cache' => [
    'array' => [
        'class'     => \Dot\Cache\Adapter\ArrayAdapter::class,
    ],
    'filesystem' => [
        'class'     => \Dot\Cache\Adapter\FilesystemAdapter::class,
        'directory' => getcwd() . '/data/cache',
        'namespace' => 'doctrine',
    ],
],
```

You can store `result_cache`, `metadata_cache`, `query_cache`, `hydration_cache` into files using the `filesystem` adapter, or you can store the `result_cache` into memory using the `array` adapter.

Configuration example for both in-memory and filesystem adapters
----------------------------------------------------------------

[](#configuration-example-for-both-in-memory-and-filesystem-adapters)

Configuration sample for `config\autoload\doctrine.global.php` file:

```
return [
    'dependencies'        => [
        'factories' => [
            \Dot\Cache\Adapter\FilesystemAdapter::class => \Dot\Cache\Factory\FilesystemAdapterFactory::class,
        'aliases'   => [
            \Symfony\Component\Cache\Adapter\FilesystemAdapter::class => \Dot\Cache\Adapter\FilesystemAdapter::class
        ],
    ],
    'doctrine'            => [
        'configuration' => [
            'orm_default' => [
                'result_cache'       => 'array',
                'metadata_cache'     => 'array',
                'query_cache'        => 'filesystem',
                'hydration_cache'    => 'array',
                'second_level_cache' => [
                    'enabled'                    => true,
                    'default_lifetime'           => 3600,
                    'default_lock_lifetime'      => 60,
                    'file_lock_region_directory' => '',
                    'regions'                    => [],
                ],
            ],
        ],
        'cache'      => [
            'array' => [
                'class'     => \Symfony\Component\Cache\Adapter\ArrayAdapter::class,
            ],
            'filesystem' => [
                'class'     => \Dot\Cache\Adapter\FilesystemAdapter::class,
                'directory' => getcwd() . '/data/cache',
                'namespace' => 'doctrine',
            ],
        ],
    ],
];
```

> The above configuration is just a sample, it should not be used as it is.

You can enable/disable the caching system using the `doctrine.configuration.orm_default.second_level_cache.enabled` key.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance60

Regular maintenance activity

Popularity33

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~175 days

Recently: every ~70 days

Total

19

Last Release

201d ago

Major Versions

v1.1.1 → v2.0.02020-01-30

v2.0.0 → 3.0.02022-04-06

2.0.x-dev → 3.1.02023-03-29

3.1.3 → 4.0.02024-02-22

PHP version history (8 changes)1.0.0PHP ^7.1

v2.0.0PHP ^7.2

3.0.0PHP ~7.4.0 || ~8.0.0 || ~8.1.0

3.1.2PHP ~8.0.0 || ~8.1.0 || ~8.2.0

3.0.x-devPHP ~8.1.0 || ~8.2.0 || ~8.3.0

4.0.0PHP ~8.2.0 || ~8.3.0

4.2.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

4.0.x-devPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1156873?v=4)[Dotkernel](/maintainers/dotkernel)[@dotkernel](https://github.com/dotkernel)

---

Top Contributors

[![arhimede](https://avatars.githubusercontent.com/u/22009710?v=4)](https://github.com/arhimede "arhimede (19 commits)")[![MarioRadu](https://avatars.githubusercontent.com/u/10761919?v=4)](https://github.com/MarioRadu "MarioRadu (15 commits)")[![marioradu05](https://avatars.githubusercontent.com/u/10761919?v=4)](https://github.com/marioradu05 "marioradu05 (15 commits)")[![alexmerlin](https://avatars.githubusercontent.com/u/4542449?v=4)](https://github.com/alexmerlin "alexmerlin (12 commits)")[![n3vrax](https://avatars.githubusercontent.com/u/5805542?v=4)](https://github.com/n3vrax "n3vrax (9 commits)")[![bidi47](https://avatars.githubusercontent.com/u/27284979?v=4)](https://github.com/bidi47 "bidi47 (5 commits)")[![Howriq](https://avatars.githubusercontent.com/u/63609103?v=4)](https://github.com/Howriq "Howriq (3 commits)")[![gabidj](https://avatars.githubusercontent.com/u/3998573?v=4)](https://github.com/gabidj "gabidj (2 commits)")[![claurospace](https://avatars.githubusercontent.com/u/224870609?v=4)](https://github.com/claurospace "claurospace (1 commits)")[![pinclau](https://avatars.githubusercontent.com/u/24491812?v=4)](https://github.com/pinclau "pinclau (1 commits)")

---

Tags

independentlaminasdoctrinecacheservicesdotkernelsymfony-cachedoctrine-cache

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dotkernel-dot-cache/health.svg)

```
[![Health](https://phpackages.com/badges/dotkernel-dot-cache/health.svg)](https://phpackages.com/packages/dotkernel-dot-cache)
```

###  Alternatives

[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[doctrine/doctrine-orm-module

Laminas Module that provides Doctrine ORM functionality

4407.3M293](/packages/doctrine-doctrine-orm-module)[doctrine/doctrine-module

Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules

3957.9M116](/packages/doctrine-doctrine-module)[doctrine/doctrine-mongo-odm-module

Laminas Module which provides Doctrine MongoDB ODM functionality

86676.6k35](/packages/doctrine-doctrine-mongo-odm-module)[doctrine/doctrine-laminas-hydrator

Doctrine hydrators for Laminas applications

362.8M19](/packages/doctrine-doctrine-laminas-hydrator)[cache/cache-bundle

Symfony 2 bundle providing integration between PSR-6 compliant cache services and the framework. It supports cache for sessions, routing and Doctrine

43437.0k](/packages/cache-cache-bundle)

PHPackages © 2026

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