Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit a176c47

Browse files
committed
Described command-line operations in README.md
1 parent e9dab1a commit a176c47

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,41 @@ Or in your template:
6464
```
6565

6666
#### :computer: CLI command interactions
67-
@todo :|
67+
As of the V3, some command-line tools were introduced, mostly for CRUD-like operations.
68+
69+
##### GET operation
70+
```bash
71+
php bin/console phpfastcache:get filecache cacheKey
72+
```
73+
This will display the content of a cache item if it eventually exists.
74+
75+
76+
##### SET operation
77+
```bash
78+
php bin/console phpfastcache:get filecache cacheKey '{"a": 14}' 300 -a 1
79+
```
80+
This will set the content of a cache item.
81+
The TTL (300), in seconds, is optional and take the default value filled in your configuration file.
82+
The `auto-type-cast` option _"-a"_ (enabled by default) will let allows you to automatically type cast your variable.
83+
`false` and `true` will be converted to _boolean_.
84+
`null` will be converted to _null_.
85+
`1337` and `1337.666` will be converted to _integer_ or _float_.
86+
`{"a": 14}` will be converted to an associative _array_ using a JSON detection
87+
You can obviously disable this behavior by turning off the `auto-type-cast` option: `-a 0`
88+
89+
##### DELETE operation
90+
```bash
91+
php bin/console phpfastcache:del filecache cacheKey
92+
```
93+
This will delete the specified cache item.
94+
95+
##### CLEAR operation
96+
```bash
97+
php bin/console phpfastcache:clear filecache
98+
# OR to clear every caches:
99+
php bin/console phpfastcache:clear
100+
```
101+
This will clear a single cache instance if specified or all the configured cache instances otherwise.
68102

69103
#### :bulb: Introducing Cacheable Responses (V3 only)
70104
As of the V3 there's a new, easier and cleaner way to setup HTTP cache to decrease your server bandwidth along with your CPU load: Cacheable Responses.

0 commit comments

Comments
 (0)