Extends EasyDB, caches Prepared Statements to reduce the number of database round trips. Requires PHP 8.0 or newer.
composer require paragonie/easydb-cache
To use EasyDB with prepared statement caching, you can either change the class you're importing
in your code, or update your code to use EasyDBCache
instead. Alternatively, you can use the
named constructor with your existing object.
Afterwards, the EasyDB API is exactly the same as EasyDBCache.
- use ParagonIE\EasyDB\EasyDB;
+ use ParagonIE\EasyDB\EasyDBCache;
use ParagonIE\EasyDB\EasyDB;
+ use ParagonIE\EasyDB\EasyDBCache;
- $db = new EasyDB(
+ $db = new EasyDBCache(
+ use ParagonIE\EasyDB\EasyDBCache;
- $db = new EasyDB(/* ... */);
+ $db = EasyDBCache::fromEasyDB(new EasyDB(/* ... */));
If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.