mirror of
https://github.com/Mactronique/phpcache-bundle.git
synced 2026-03-24 17:02:12 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2663cd6aac | ||
|
|
04075873b6 | ||
|
|
62442e243a |
@@ -32,6 +32,8 @@ class Configuration implements ConfigurationInterface
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->arrayNode('options')
|
||||
->useAttributeAsKey('opt_name', true)
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
|
||||
27
README.md
27
README.md
@@ -31,6 +31,14 @@ mactronique_php_cache:
|
||||
drivers:
|
||||
-
|
||||
name: xcache
|
||||
-
|
||||
name: redis
|
||||
options:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: ''
|
||||
database: 1
|
||||
timeout: 1
|
||||
-
|
||||
name: memcached
|
||||
options:
|
||||
@@ -42,6 +50,25 @@ mactronique_php_cache:
|
||||
name: "null"
|
||||
```
|
||||
|
||||
# Use
|
||||
|
||||
In controller :
|
||||
```
|
||||
// Set value into key for 30 seconds
|
||||
$this->get('mactronique_cache.phpcache')->set('key', 'value', 30);
|
||||
|
||||
// Set value into key
|
||||
$this->get('mactronique_cache.phpcache')->set('key', 'value');
|
||||
|
||||
//get key
|
||||
$this->get('mactronique_cache.phpcache')->get('key');
|
||||
|
||||
//check if key exists
|
||||
$this->get('mactronique_cache.phpcache')->exists('key');
|
||||
|
||||
//remove key
|
||||
$this->get('mactronique_cache.phpcache')->remove('key');
|
||||
```
|
||||
# Contributing
|
||||
|
||||
Please fork main repo and send a pull request with your change.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
services:
|
||||
mactronique_cache.redis:
|
||||
class: Mactronique\PhpCache\Driver\RedisDriver
|
||||
arguments: ['%mactronique_cache.redis.options%']
|
||||
tags:
|
||||
- { name: mactronique_cache.driver }
|
||||
@@ -6,7 +6,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jean-Baptiste Nahan",
|
||||
"email": "jbnahan@gmail.com"
|
||||
"email": "macintoshplus@users.noreply.github.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
@@ -26,5 +26,6 @@
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"abandoned": "doctrine/doctrine-cache-bundle"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user