vB_Datastore
in package
Uses
vB_Trait_NoSerialize
Class for fetching and initializing the vBulletin datastore from the database
Tags
Table of Contents
Constants
- BITFIELDS_PREFIX = 'bf_'
- BITFIELDS_TITLE = 'bitfields'
Methods
- __construct() : mixed
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- build() : mixed
- This method replaces the legacy function build_datastore
- build_options() : array<string|int, mixed>
- Reads settings from the settings then saves the values to the datastore
- clearValues() : mixed
- This method is intended only for unit testing. Do NOT use it in other context.
- delete() : void
- Delete a datastore entry
- fetch() : bool
- Fetches the contents of the datastore from the database
- get_value() : mixed
- getKeys() : array<string|int, mixed>
- Get the list of all datastore keys
- getOption() : mixed
- getValue() : mixed
- init_registry() : mixed
- Temporary function to manage initializing the legacy registry from the datastore
- preload() : mixed
- Set an array of items that should be preloaded. These will not be loaded immediately but will be fetched on the first call to getValue.
- registerCount() : mixed
- resetCache() : mixed
- Resets datastore cache
- setOption() : mixed
- setValue() : mixed
- This method is intended only for unit testing. Do NOT use it in other context.
Constants
BITFIELDS_PREFIX
public
mixed
BITFIELDS_PREFIX
= 'bf_'
BITFIELDS_TITLE
public
mixed
BITFIELDS_TITLE
= 'bitfields'
Methods
__construct()
public
__construct(mixed &$config, mixed &$db_assertor) : mixed
Parameters
- $config : mixed
- $db_assertor : mixed
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
build()
This method replaces the legacy function build_datastore
public
build([string $title = '' ][, string $data = '' ][, int $unserialize = 0 ][, bool $storelocal = true ]) : mixed
Parameters
- $title : string = ''
- $data : string = ''
- $unserialize : int = 0
- $storelocal : bool = true
-
-- if we should keep a local copy in memory as if this item had been loaded. This prevents the mass rebuilding of large datastore items from overloading the available memory.
build_options()
Reads settings from the settings then saves the values to the datastore
public
build_options() : array<string|int, mixed>
After reading the contents of the setting table, the function will rebuild the $vbulletin->options array, then serialize the array and save that serialized array into the 'options' entry of the datastore in the database
Extracted from adminfunctions.php
Return values
array<string|int, mixed> —The $vbulletin->options array
clearValues()
This method is intended only for unit testing. Do NOT use it in other context.
public
clearValues() : mixed
Clear all the cache class vars, useful to calculate every value again.
delete()
Delete a datastore entry
public
delete( $title) : void
Parameters
fetch()
Fetches the contents of the datastore from the database
public
fetch(mixed $items) : bool
Parameters
- $items : mixed
Return values
boolget_value()
public
get_value(mixed $title) : mixed
Parameters
- $title : mixed
Tags
getKeys()
Get the list of all datastore keys
public
getKeys() : array<string|int, mixed>
Return values
array<string|int, mixed> —-- string array of titles of the datastore keys stored.
getOption()
public
getOption(mixed $name) : mixed
Parameters
- $name : mixed
getValue()
public
getValue(mixed $title) : mixed
Parameters
- $title : mixed
init_registry()
Temporary function to manage initializing the legacy registry from the datastore
public
init_registry() : mixed
Tags
preload()
Set an array of items that should be preloaded. These will not be loaded immediately but will be fetched on the first call to getValue.
public
preload(array<string|int, mixed> $titles) : mixed
Parameters
- $titles : array<string|int, mixed>
registerCount()
public
registerCount() : mixed
resetCache()
Resets datastore cache
public
resetCache() : mixed
setOption()
public
setOption(mixed $name, mixed $value[, mixed $save = true ]) : mixed
Parameters
- $name : mixed
- $value : mixed
- $save : mixed = true
setValue()
This method is intended only for unit testing. Do NOT use it in other context.
public
setValue(string $title, mixed $value) : mixed
Parameters
- $title : string
- $value : mixed