Skip to content

Commit f964f25

Browse files
committed
added usage of disableCaching and enableCaching
1 parent a674c1f commit f964f25

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

README.md

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
DominoCacheStore
2-
=================
1+
# DominoCacheStore
2+
33
[![Build Status](https://travis-ci.org/SNakano/CacheStore.png)](https://travis-ci.org/SNakano/CacheStore)
44
[![Latest Stable Version](https://poser.pugx.org/snakano/cache-store/v/stable.svg)](https://packagist.org/packages/snakano/cache-store)
55
[![Total Downloads](https://poser.pugx.org/snakano/cache-store/downloads.svg)](https://packagist.org/packages/snakano/cache-store)
@@ -12,8 +12,7 @@ provides a generic way to cache any data.
1212
- support namespace. (use namespace delete)
1313

1414

15-
Install
16-
-------
15+
## Install
1716

1817
using Composer(recommended):
1918

@@ -27,8 +26,7 @@ using Composer(recommended):
2726
or cloning this repository.
2827

2928

30-
Usage
31-
-----
29+
## Usage
3230

3331
```php
3432
// configure cache setting.
@@ -89,9 +87,18 @@ $storage->get('ns2', 'key1');
8987
$storage->clearAll();
9088
$storage->get('ns2', 'key1');
9189
# => null
90+
91+
// disable caching at runtime
92+
Domino\CacheStore\Factory::disableCaching();
93+
// since caching is disabled, the factory will return an instance of "NoCache"
94+
$storage = Domino\CacheStore\Factory::factory('memcached');
95+
96+
// enable caching at runtime
97+
Domino\CacheStore\Factory::enableCaching();
98+
// since caching is enabled again, the factory will return an instance of "Memcached"
99+
$storage = Domino\CacheStore\Factory::factory('memcached');
92100
```
93101

94-
License
95-
-------
102+
## License
96103

97104
MIT license.

0 commit comments

Comments
 (0)