Download the PHP package pinkcrab/wp-psr16-cache without Composer
On this page you can find all versions of the php package pinkcrab/wp-psr16-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pinkcrab/wp-psr16-cache
More information about pinkcrab/wp-psr16-cache
Files in pinkcrab/wp-psr16-cache
Package wp-psr16-cache
Short Description A WordPress based implementation of the PSR16 Cacheinterface using transient or the WP_File_System
License MIT
Homepage https://pinkcrab.co.uk
Informations about the package wp-psr16-cache
WP PSR16 Simple Cache
Provides both WP Transient and WP FileSystem (Direct) implementation to PSR16`s CacheInterface.
Requirements
Requires Composer and WordPress.
- Tested with PHP7.1, 7.2, 7.3, 7.4, 8.0, 8.1
- Tested with WP5.5, 5.6, 5.7, 5.8, 5.9
Installation
Getting Started
Once you have the package installed and your autoloader has been included.
File Cache
File_Cache
Will create the defined base directory when the object is created.
The constructor takes 2 properties the path and the file extension. By default the file extension is .do.
If you plan on using this as a plugin and want to clean up after an install. You can just create an instance of the Class on activation and then run clear on uninstall
Transient Cache
Makes use of prefixed/grouped transient values. Preventing collisions while still allowing short and clean keys.
The constructor takes a single argument, this denotes the group that your transients will be created using. This can be omitted if you wanted no prefix on your keys.
PLEASE NOTE: Calling clear() will use $wpdb to get all transients from the database and clear any which start with your prefix. If you have no prefix defined, this could clear all of your transients and create some unusual side effected.
ALSO: Some managed hosts store transients outside of the regular Options table. This can lead to problems when fetching all transients with your prefix.
Changelog
- 2.0.4 - Updated dev dependencies and added scrutinizer to CI
- 2.0.3 - Fixed missing wp filesystem include
- 2.0.2 - Readme formatting, added in additional tests for 100% coverage.
- 2.0.1 - Fixed trailin comma issue in File_Cache and setup all github CI workflows.
- 2.0.0 - Moved to composer and switched to using WP_FileSystem over raw PHP functions.