MediaWiki REL1_39
Wikimedia\DependencyStore\DependencyStore Class Reference

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

Inheritance diagram for Wikimedia\DependencyStore\DependencyStore:

Public Member Functions

 newEntityDependencies (array $paths=[], $asOf=null)
 
 remove ( $type, $entities)
 Delete the currently tracked dependencies for an entity or set of entities.
 
 retrieve ( $type, $entity)
 Get the currently tracked dependencies for an entity.
 
 retrieveMulti ( $type, array $entities)
 Get the currently tracked dependencies for a set of entities.
 
 store ( $type, $entity, array $data, $ttl)
 Set the currently tracked dependencies for an entity.
 
 storeMulti ( $type, array $dataByEntity, $ttl)
 Set the currently tracked dependencies for a set of entities.
 

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 28 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 39 of file DependencyStore.php.

Referenced by Wikimedia\DependencyStore\KeyValueDependencyStore\retrieveMulti(), and Wikimedia\DependencyStore\SqlModuleDependencyStore\retrieveMulti().

◆ remove()

Wikimedia\DependencyStore\DependencyStore::remove ( $type,
$entities )
abstract

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

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

Reimplemented in Wikimedia\DependencyStore\KeyValueDependencyStore, and Wikimedia\DependencyStore\SqlModuleDependencyStore.

◆ retrieve()

Wikimedia\DependencyStore\DependencyStore::retrieve ( $type,
$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$typeEntity type
string$entityEntity name
Returns
array Map of (paths: paths, asOf: UNIX timestamp or null)

Definition at line 57 of file DependencyStore.php.

References $type, and Wikimedia\DependencyStore\DependencyStore\retrieveMulti().

◆ retrieveMulti()

Wikimedia\DependencyStore\DependencyStore::retrieveMulti ( $type,
array $entities )
abstract

Get the currently tracked dependencies for a set of entities.

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

Reimplemented in Wikimedia\DependencyStore\KeyValueDependencyStore, and Wikimedia\DependencyStore\SqlModuleDependencyStore.

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

◆ store()

Wikimedia\DependencyStore\DependencyStore::store ( $type,
$entity,
array $data,
$ttl )
final

Set the currently tracked dependencies for an entity.

Parameters
string$typeEntity type
string$entityEntity name
array$dataMap of (paths: paths, asOf: UNIX timestamp or null)
int$ttlNew time-to-live in seconds

Definition at line 79 of file DependencyStore.php.

References $type, and Wikimedia\DependencyStore\DependencyStore\storeMulti().

◆ storeMulti()

Wikimedia\DependencyStore\DependencyStore::storeMulti ( $type,
array $dataByEntity,
$ttl )
abstract

Set the currently tracked dependencies for a set of entities.

See also
KeyValueDependencyStore::store()
Parameters
string$typeEntity type
array[]$dataByEntityMap of (entity => (paths: paths, asOf: UNIX timestamp or null))
int$ttlNew time-to-live in seconds

Reimplemented in Wikimedia\DependencyStore\KeyValueDependencyStore, and Wikimedia\DependencyStore\SqlModuleDependencyStore.

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


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