MediaWiki REL1_39
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
57 final public function retrieve( $type, $entity ) {
58 return $this->retrieveMulti( $type, [ $entity ] )[$entity];
59 }
60
69 abstract public function retrieveMulti( $type, array $entities );
70
79 final public function store( $type, $entity, array $data, $ttl ) {
80 $this->storeMulti( $type, [ $entity => $data ], $ttl );
81 }
82
92 abstract public function storeMulti( $type, array $dataByEntity, $ttl );
93
100 abstract public function remove( $type, $entities );
101}
Track per-module dependency file paths 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.