*
* @file
*/
+use Wikimedia\ScopedCallback;
/**
* Gives access to properties of a page.
$this->cache = new ProcessCacheLRU( self::CACHE_SIZE );
}
+ /**
+ * Ensure that cache has at least this size
+ * @param int $size
+ */
+ public function ensureCacheSize( $size ) {
+ if ( $this->cache->getSize() < $size ) {
+ $this->cache->resize( $size );
+ }
+ }
+
/**
* Given one or more Titles and one or more names of properties,
* returns an associative array mapping page ID to property value.
* single Title is provided, it does not need to be passed in an array,
* but an array will always be returned. If a single property name is
* provided, it does not need to be passed in an array. In that case,
- * an associtive array mapping page ID to property value will be
+ * an associative array mapping page ID to property value will be
* returned; otherwise, an associative array mapping page ID to
* an associative array mapping property name to property value will be
* returned. An empty array will be returned if no matching properties
}
if ( $queryIDs ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$result = $dbr->select(
'page_props',
[
}
if ( $queryIDs != [] ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$result = $dbr->select(
'page_props',
[