MediaWiki master
Wikimedia\DependencyStore\DependencyStore Class Reference

Track per-module dependency file paths that are expensive to mass compute. More...

Public Member Functions

 __construct (BagOStuff $stash)
 
 newEntityDependencies (array $paths=[], $asOf=null)
 
 remove ( $entities)
 Delete the currently tracked dependencies for an entity or set of entities.
 
 retrieve ( $entity)
 Get the currently tracked dependencies for an entity.
 
 retrieveMulti (array $entities)
 Get the currently tracked dependencies for a set of entities.
 
 storeMulti (array $pathByEntity)
 

Public Attributes

array $updateBuffer = []
 Map of (module-variant => buffered DependencyStore updates)
 

Protected Attributes

const KEY_AS_OF = 'asOf'
 
const KEY_PATHS = 'paths'
 

Detailed Description

Track per-module dependency file paths that are expensive to mass compute.

Access: internal
For use by ResourceLoader\Module only

Definition at line 33 of file DependencyStore.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\DependencyStore\DependencyStore::__construct ( BagOStuff $stash)
Parameters
BagOStuff$stashStorage backend

Definition at line 49 of file DependencyStore.php.

Member Function Documentation

◆ newEntityDependencies()

Wikimedia\DependencyStore\DependencyStore::newEntityDependencies ( array $paths = [],
$asOf = null )
Parameters
string[]$pathsList of dependency paths
int | null$asOfUNIX timestamp or null
Returns
array

Definition at line 58 of file DependencyStore.php.

Referenced by Wikimedia\DependencyStore\DependencyStore\retrieveMulti(), and Wikimedia\DependencyStore\DependencyStore\storeMulti().

◆ remove()

Wikimedia\DependencyStore\DependencyStore::remove ( $entities)

Delete the currently tracked dependencies for an entity or set of entities.

Parameters
string | string[]$entitiesEntity name(s)

Definition at line 175 of file DependencyStore.php.

◆ retrieve()

Wikimedia\DependencyStore\DependencyStore::retrieve ( $entity)
final

Get the currently tracked dependencies for an entity.

The "paths" field contains a sorted list of unique paths

The "asOf" field reflects the last-modified timestamp of the dependency data itself. It will be null if there is no tracking data available. Note that if empty path lists are never stored (as an optimisation) then it will not be possible to discern whether the result is up-to-date.

Parameters
string$entityEntity name
Returns
array Map of (paths: paths, asOf: UNIX timestamp or null)

Definition at line 75 of file DependencyStore.php.

References Wikimedia\DependencyStore\DependencyStore\retrieveMulti().

◆ retrieveMulti()

Wikimedia\DependencyStore\DependencyStore::retrieveMulti ( array $entities)

Get the currently tracked dependencies for a set of entities.

Parameters
string[]$entitiesEntity names
Returns
array[] Map of (entity => (paths: paths, asOf: UNIX timestamp or null))

Definition at line 85 of file DependencyStore.php.

References Wikimedia\DependencyStore\DependencyStore\newEntityDependencies().

Referenced by Wikimedia\DependencyStore\DependencyStore\retrieve().

◆ storeMulti()

Wikimedia\DependencyStore\DependencyStore::storeMulti ( array $pathByEntity)
Parameters
array$pathByEntity

Definition at line 109 of file DependencyStore.php.

References Wikimedia\DependencyStore\DependencyStore\newEntityDependencies().

Member Data Documentation

◆ $updateBuffer

array Wikimedia\DependencyStore\DependencyStore::$updateBuffer = []

Map of (module-variant => buffered DependencyStore updates)

Definition at line 44 of file DependencyStore.php.

◆ KEY_AS_OF

const Wikimedia\DependencyStore\DependencyStore::KEY_AS_OF = 'asOf'
protected

Definition at line 35 of file DependencyStore.php.

◆ KEY_PATHS

const Wikimedia\DependencyStore\DependencyStore::KEY_PATHS = 'paths'
protected

Definition at line 34 of file DependencyStore.php.


The documentation for this class was generated from the following file: