This WordPress bundle configures the standalone snicco/better-wpdb library for usage in applications based on snicco/kernel.
composer install snicco/better-wpdb-bundleThis bundle has no configuration options currently.
Add the BetterWPDBBundle to your bundles.php configuration file.
<?php
// /path/to/configuration/bundles.php
use Snicco\Bundle\BetterWPDB\BetterWPDBBundle;
return [
'bundles' => [
Snicco\Component\Kernel\ValueObject\Environment::ALL => [
BetterWPDBBundle::class
]
]
];You can now lazily resolve a BetterWPDB instance from the booted kernel.
use Snicco\Component\BetterWPDB\BetterWPDB;
use Snicco\Component\Kernel\Kernel;
/**
* @var Kernel $kernel
*/
$kernel->boot();
$better_wpdb = $kernel->container()->make(BetterWPDB::class);If an instance of QueryLogger is bound in the kernel container is will be used when creating the BetterWPDB instance.
Otherwise, no queries will be logged.
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.