MediaWiki REL1_35
DependencyStore.php
Go to the documentation of this file.
1<?php
22
28abstract 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}
Class for tracking per-entity dependency path lists that are expensive to mass compute.
storeMulti( $type, array $dataByEntity, $ttl)
Set the currently tracked dependencies for a set of entities.
newEntityDependencies(array $paths=[], $asOf=null)
retrieve( $type, $entity)
Get the currently tracked dependencies for an entity.
store( $type, $entity, array $data, $ttl)
Set the currently tracked dependencies for an entity.
retrieveMulti( $type, array $entities)
Get the currently tracked dependencies for a set of entities.
renew( $type, $entities, $ttl)
Set the expiry for the currently tracked dependencies for an entity or set of entities.