vB_Datastore_WinCache
extends vB_Datastore
in package
Class for fetching and initializing the vBulletin datastore from WinCache
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() : void
- Updates the appropriate cache file
- build_options() : array<string|int, mixed>
- Reads settings from the settings then saves the values to the datastore
- buildSerialized() : void
- Cover for build that hides the serialization details.
- clearValues() : mixed
- This method is intended only for unit testing. Do NOT use it in other context.
- delete() : void
- Delete a datastore entry
- fetch() : void
- Fetches the contents of the datastore from WinCache
- 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()
Updates the appropriate cache file
public
build([mixed $title = '' ][, mixed $data = '' ][, mixed $unserialize = 0 ][, mixed $storelocal = true ]) : void
Parameters
- $title : mixed = ''
- $data : mixed = ''
- $unserialize : mixed = 0
- $storelocal : mixed = 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 options array, then serialize the array and save that serialized array into the 'options' entry of the datastore in the database
Return values
array<string|int, mixed>buildSerialized()
Cover for build that hides the serialization details.
public
buildSerialized(string $title, mixed $data[, bool $storelocal = true ]) : void
Previously we had the caller serialize the data and set the unserialize to indicate they did that but it's better to ensure this stays in sync.
Parameters
- $title : string
- $data : mixed
- $storelocal : bool = true
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(mixed $title) : void
Parameters
- $title : mixed
-
datastore entry to delete
fetch()
Fetches the contents of the datastore from WinCache
public
fetch(mixed $items) : void
Parameters
- $items : mixed
get_value()
public
get_value(mixed $title) : mixed
Parameters
- $title : mixed
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
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