Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

cache

> 数据库
Open source

[Deprecated] Cache library

327 stars0 likes2 views
WebsiteGitHub

About

[Deprecated] Cache library

Cache

WARNING: This repository is deprecated

Cache is a small library to handle cache backend, the library also handle counter.

Installation using Composer

bash
composer require sonata-project/cache

Cache Usage

php
 '127.0.0.1',
    'port'     => 6379,
    'database' => 42,
]);

$keys = [
    'objectId' => 10,
];

$adapter->set($keys, 'MyValue', 86400);

$cacheElement = $adapter->get($keys);

$cacheElement->getData(); // MyValue

Counter Usage

php
 '127.0.0.1',
    'port'     => 6379,
    'database' => 42,
]);

$counter = $adapter->increment('mystats');

// $counter is a Counter object
$counter->getValue(); // will return 1 if the counter is new

$counter = $adapter->increment($counter, 10);

$counter->getValue(); // will return 11

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPcachememcachedmongodbphp

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库