Skip to content

Commit 5328f5f

Browse files
committed
Added OPTIONS.md
(cherry picked from commit 7d1b13c)
1 parent 83c9197 commit 5328f5f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/OPTIONS.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
PhpFastCache has some options that you may want to know before using them, here's the list:
2+
3+
### File-based drivers options *
4+
* **default_chmod** _| int>octal (default: 0777)_ `[>=V4]` This option will define the chmod used to write driver cache files.
5+
* **securityKey** _| string (default: 'auto')_ `[>=V4]` A security key that define the subdirectory name. 'auto' value will be the HTTP_HOST value.
6+
* **path** _| string (default: Tmp directory)_ `[>=V4]` The absolute path where the written cache files belong to.
7+
* **htaccess** _| bool (default: true)_ `[>=V4]` Option designed to (dis)allow the auto-generation of .htaccess.
8+
* **autoTmpFallback** _| bool (default: false)_ `[>=V6]`Option designed to automatically attempt to fallback to temporary directory if the cache fails to write on the specified directory
9+
* **secureFileManipulation** _| bool (default: false)_ `[>=V6]` This option enforces a strict I/O manipulation policy by adding more integrity checks. This option may slow down the write operations, therefore you must use it with caution. In case of failure an **phpFastCacheIOException** exception will be thrown. Currently only supported by _Files_ driver.
10+
* **cacheFileExtension** _| string (default: 'txt')_ `[>=V6.0.2]` This allows you to setup a custom (but safe) cache file extension.
11+
12+
\* Drivers like _Files_, _Sqlite_, _Leveldb_, etc.
13+
14+
### Global options
15+
* **fallback** _| string|bool_ (default: false)`[>=V4.2]` A driver name used in case the main driver stopped working. E.g. a missing php extension.
16+
* **compress_data** _| bool (default: false)_ `[>=V4.3]` Compress stored data, if the backend supports it. Currently only supported by _Memcache(d)_ driver.
17+
* **limited_memory_each_object** _| int (default: 4096)_ `[>=V4.2]` Maximum size (bytes) of object stored in memory. Currently only supported by _Cookie_ driver.
18+
* **defaultTtl** _| int (default: 900)_ `[>=V5]` This option define a default ttl (time-to-live, in seconds) for item that has no specified expiration date/ttl.
19+
* **itemDetailedDate** _| bool (default: false)_ `[>=V6]` This option will define if the Items will make use of detailed dates such as Creation/modification date. Trying to access to these date without being explicitly enabled will throw a `LogicException`
20+
* **defaultKeyHashFunction** _| string (default: 'md5')_ `[>=V6]` This option will allow you to define a custom hash function for the `$item->getEncodedKey()` method. Callable objects are not allowed, but static method such as `\Absolute\Namespace\ToStatic::method` are allowed.
21+
* **preventCacheSlams** _| bool (default: false)_ `[>=V6]` This option will allow you to prevent cache slams when making use of heavy cache items
22+
* **cacheSlamsTimeout** _| int (default: 15)_ `[>=V6]` This option defines the cache slams timeout in seconds
23+
24+
### Host/Authenticating options *
25+
* **host** _| string (default: not set)_ The host
26+
* **port** _| int (default: not set)_ The port
27+
* **username** _| string (default: not set)_ The username
28+
* **password** _| string (default: not set)_ The password
29+
* **timeout** _| int (default: not set)_ The timeout (in seconds)
30+
31+
These options differs depending the driver that you are using, see **/Examples** folder for more information about these options.
32+
33+
\* Drivers like _CouchBase_, _MongoDb_, _(P)redis_, _Ssdb_, etc.
34+

0 commit comments

Comments
 (0)