MediaWiki  master
DependencyStore.php
Go to the documentation of this file.
1 <?php
22 
28 abstract class DependencyStore {
30  protected const KEY_PATHS = 'paths';
32  protected const KEY_AS_OF = 'asOf';
33 
39  public function newEntityDependencies( array $paths = [], $asOf = null ) {
40  return [ self::KEY_PATHS => $paths, self::KEY_AS_OF => $asOf ];
41  }
42 
58  final public function retrieve( $type, $entity ) {
59  return $this->retrieveMulti( $type, [ $entity ] )[$entity];
60  }
61 
72  abstract public function retrieveMulti( $type, array $entities );
73 
91  final public function store( $type, $entity, array $data, $ttl ) {
92  $this->storeMulti( $type, [ $entity => $data ], $ttl );
93  }
94 
106  abstract public function storeMulti( $type, array $dataByEntity, $ttl );
107 
115  abstract public function remove( $type, $entities );
116 
125  abstract public function renew( $type, $entities, $ttl );
126 }
Wikimedia\DependencyStore\DependencyStore\renew
renew( $type, $entities, $ttl)
Set the expiry for the currently tracked dependencies for an entity or set of entities.
Wikimedia\DependencyStore
Definition: DependencyStore.php:21
Wikimedia\DependencyStore\DependencyStore\storeMulti
storeMulti( $type, array $dataByEntity, $ttl)
Set the currently tracked dependencies for a set of entities.
Wikimedia\DependencyStore\DependencyStore\retrieve
retrieve( $type, $entity)
Get the currently tracked dependencies for an entity.
Definition: DependencyStore.php:58
Wikimedia\DependencyStore\DependencyStore\store
store( $type, $entity, array $data, $ttl)
Set the currently tracked dependencies for an entity.
Definition: DependencyStore.php:91
Wikimedia\DependencyStore\DependencyStore\newEntityDependencies
newEntityDependencies(array $paths=[], $asOf=null)
Definition: DependencyStore.php:39
Wikimedia\DependencyStore\DependencyStore\retrieveMulti
retrieveMulti( $type, array $entities)
Get the currently tracked dependencies for a set of entities.
Wikimedia\DependencyStore\DependencyStore
Class for tracking per-entity dependency path lists that are expensive to mass compute.
Definition: DependencyStore.php:28
$type
$type
Definition: testCompression.php:52