dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Linker: Remove whiny FIXME comments"
[lhc/web/wiklou.git]
/
includes
/
libs
/
ProcessCacheLRU.php
diff --git
a/includes/libs/ProcessCacheLRU.php
b/includes/libs/ProcessCacheLRU.php
index
eec31ce
..
03e23ed
100644
(file)
--- a/
includes/libs/ProcessCacheLRU.php
+++ b/
includes/libs/ProcessCacheLRU.php
@@
-28,10
+28,10
@@
use Wikimedia\Assert\Assert;
*/
class ProcessCacheLRU {
/** @var Array */
*/
class ProcessCacheLRU {
/** @var Array */
- protected $cache =
array()
; // (key => prop => value)
+ protected $cache =
[]
; // (key => prop => value)
/** @var Array */
/** @var Array */
- protected $cacheTimes =
array()
; // (key => prop => UNIX timestamp)
+ protected $cacheTimes =
[]
; // (key => prop => UNIX timestamp)
protected $maxCacheKeys; // integer; max entries
protected $maxCacheKeys; // integer; max entries
@@
-109,8
+109,8
@@
class ProcessCacheLRU {
*/
public function clear( $keys = null ) {
if ( $keys === null ) {
*/
public function clear( $keys = null ) {
if ( $keys === null ) {
- $this->cache =
array()
;
- $this->cacheTimes =
array()
;
+ $this->cache =
[]
;
+ $this->cacheTimes =
[]
;
} else {
foreach ( (array)$keys as $key ) {
unset( $this->cache[$key] );
} else {
foreach ( (array)$keys as $key ) {
unset( $this->cache[$key] );
@@
-149,4
+149,12
@@
class ProcessCacheLRU {
unset( $this->cache[$key] );
$this->cache[$key] = $item;
}
unset( $this->cache[$key] );
$this->cache[$key] = $item;
}
+
+ /**
+ * Get cache size
+ * @return int
+ */
+ public function getSize() {
+ return $this->maxCacheKeys;
+ }
}
}