Download the PHP package alleyinteractive/wp-big-pit without Composer
On this page you can find all versions of the php package alleyinteractive/wp-big-pit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alleyinteractive/wp-big-pit
More information about alleyinteractive/wp-big-pit
Files in alleyinteractive/wp-big-pit
Package wp-big-pit
Short Description The WordPress database table for everything else.
License GPL-2.0-or-later
Homepage https://github.com/alleyinteractive/wp-big-pit
Informations about the package wp-big-pit
Big Pit
The Big Pit is a key-value WordPress database table for storing things that don't make sense to store as a post, term, option, or other core data type.
Installation
You can install the package via Composer:
API
The Alley\WP\Big_Pit\Client
interface describes the create-read-update-delete operations that can be used with the Big Pit. You can type hint against this interface when using Big Pit as a dependency.
Each item in the Big Pit has a key and a group, much like the WordPress object cache. Each key is unique within a group.
Client
extends the Alley\WP\Types\Feature
interface from the Type Extensions library, which includes a boot()
method for performing side effects.
You must call boot()
before using the client. If you are compiling features using the Features
instance from Type Extensions, you can include the Big Pit client, and it will be booted with the rest of your feature classes.
Usage
Speculative Client
The Big_Speculative_Pit
decorator class tracks the items that are fetched during a given request and preloads those items in a single query the next time the same page is requested.
PSR-16 Cache Adapter
A PSR-16 adapter is available for caching data in The Pit:
Note that the cache adapter will store data in a custom array structure, as described in the wp-psr16 README.
Why Not Use Options?
There's nothing wrong with using options for storing key-value data, but it comes with overhead, including:
- Managing autoloading and the
alloptions
cache. pre_option_
andoption_
filters on the values.- Settings registration and default values.
Big Pit doesn't have autoloading, filters, or registered keys, so it might work for you if you don't need these features.
Or, you might plan to store thousands of rows, and you don't want to dilute the options table with that amount of data.
About
License
Maintainers
All versions of wp-big-pit with dependencies
alleyinteractive/composer-wordpress-autoloader Version ^1.0
alleyinteractive/wp-psr16 Version ^0.1.0
alleyinteractive/wp-type-extensions Version ^2.1
symfony/http-foundation Version ^6.4