This WordPress bundle configures the standalone snicco/better-wp-cache
library for usage in applications based on snicco/kernel
.
composer install snicco/better-wp-cache-bundle
See config/better-wp-cache.php for the available configuration options. If this file does not exist in your configuration directory the default configuration will be copied the first time the kernel is booted in dev mode.
Add the BetterWPCacheBundle
to your bundles.php
configuration file.
<?php
// /path/to/configuration/bundles.php
use Snicco\Bundle\BetterWPCache\BetterWPCacheBundle;
use Snicco\Component\Kernel\ValueObject\Environment;
return [
'bundles' => [
Environment::ALL => [
BetterWPCacheBundle::class
]
]
];
You can now lazily resolve the following services after booting the kernel:
use Cache\TagInterop\TaggableCacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
use Psr\SimpleCache\CacheInterface;
use Snicco\Component\Kernel\Kernel;
/**
* @var Kernel $kernel
*/
$kernel->boot();
$psr6_cache = $kernel->container()->make(CacheItemPoolInterface::class);
$psr16_cache = $kernel->container()->make(CacheInterface::class);
$taggable_cache = $kernel->container()->make(TaggableCacheItemInterface::class);
This repository is a read-only split of the development repo of the Snicco project.
This is how you can contribute.
Please report issues in the Snicco monorepo.
If you discover a security vulnerability within BetterWPCache, please follow our disclosure procedure.