Skip to content

Instantly share code, notes, and snippets.

@Geolim4
Last active September 17, 2016 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Geolim4/69471ccd398f2a919f109063ecc0c971 to your computer and use it in GitHub Desktop.
Save Geolim4/69471ccd398f2a919f109063ecc0c971 to your computer and use it in GitHub Desktop.

PhpFastCache has some options that you may want to know before using them, here's the list:

File-based drivers options *

  • default_chmod | int>octal (default: 0777) [>=V4] This option will define the chmod used to write driver cache files.
  • securityKey | string (default: 'auto') [>=V4] A security key that define the subdirectory name.
  • htaccess | bool (default: true) [>=V4] Option designed to (dis)allow the auto-generation of .htaccess.

* Drivers like Files, Sqlite, Leveldb, etc.

Global options

  • fallback | string|bool (default: false)[>=V4.2] A driver name used in case the main driver stopped working. E.g. a missing php extension.
  • compress_data | bool (default: false) [>=V4.3] Compress stored data, if the backend supports it. Currently only supported by Memcache(d) driver.
  • limited_memory_each_object | int (default: 4096) [>=V4.2] Maximum size (bytes) of object stored in memory. Currently only supported by Cookie driver.
  • 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.
  • itemDetailedDate | bool (default: false) [>=V5.1] 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

Host/Authenticating options *

  • host | string (default: not set) The host
  • port | int (default: not set) The port
  • username | string (default: not set) The username
  • password | string (default: not set) The password
  • timeout | int (default: not set) The timeout (in seconds)

These options differs depending the driver that you are using, see /Examples folder for more information about these options.

* Drivers like CouchBase, MongoDb, (P)redis, Ssdb, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment