X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPageProps.php;h=5579ba52714b65c852580e6931fc6151e7f94b0e;hb=a0c9fb59a934a3e7d9f31f249ab0b2b923f49db7;hp=365438472280f92c34c5af1385d5fd1a3c928b6b;hpb=83691ed06e8ec7ef1f6f7290b8c5c175ab9f4928;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/PageProps.php b/includes/PageProps.php index 3654384722..5579ba5271 100644 --- a/includes/PageProps.php +++ b/includes/PageProps.php @@ -84,6 +84,16 @@ class PageProps { $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. @@ -92,7 +102,7 @@ class PageProps { * 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