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 "Hard-deprecate authentication-related hooks deprecated by AuthManager"
[lhc/web/wiklou.git]
/
includes
/
filerepo
/
RepoGroup.php
diff --git
a/includes/filerepo/RepoGroup.php
b/includes/filerepo/RepoGroup.php
index
fa4567e
..
f3fed57
100644
(file)
--- a/
includes/filerepo/RepoGroup.php
+++ b/
includes/filerepo/RepoGroup.php
@@
-98,7
+98,7
@@
class RepoGroup {
function __construct( $localInfo, $foreignInfo ) {
$this->localInfo = $localInfo;
$this->foreignInfo = $foreignInfo;
function __construct( $localInfo, $foreignInfo ) {
$this->localInfo = $localInfo;
$this->foreignInfo = $foreignInfo;
- $this->cache = new
Process
CacheLRU( self::MAX_CACHE_SIZE );
+ $this->cache = new
Map
CacheLRU( self::MAX_CACHE_SIZE );
}
/**
}
/**
@@
-125,10
+125,12
@@
class RepoGroup {
if ( isset( $options['bypassCache'] ) ) {
$options['latest'] = $options['bypassCache']; // b/c
}
if ( isset( $options['bypassCache'] ) ) {
$options['latest'] = $options['bypassCache']; // b/c
}
+ $options += [ 'time' => false ];
if ( !$this->reposInitialised ) {
$this->initialiseRepos();
}
if ( !$this->reposInitialised ) {
$this->initialiseRepos();
}
+
$title = File::normalizeTitle( $title );
if ( !$title ) {
return false;
$title = File::normalizeTitle( $title );
if ( !$title ) {
return false;
@@
-136,17
+138,16
@@
class RepoGroup {
# Check the cache
$dbkey = $title->getDBkey();
# Check the cache
$dbkey = $title->getDBkey();
+ $timeKey = is_string( $options['time'] ) ? $options['time'] : '';
if ( empty( $options['ignoreRedirect'] )
&& empty( $options['private'] )
&& empty( $options['latest'] )
) {
if ( empty( $options['ignoreRedirect'] )
&& empty( $options['private'] )
&& empty( $options['latest'] )
) {
- $time = $options['time'] ?? '';
- if ( $this->cache->has( $dbkey, $time, 60 ) ) {
- return $this->cache->get( $dbkey, $time );
+ if ( $this->cache->hasField( $dbkey, $timeKey, 60 ) ) {
+ return $this->cache->getField( $dbkey, $timeKey );
}
$useCache = true;
} else {
}
$useCache = true;
} else {
- $time = false;
$useCache = false;
}
$useCache = false;
}
@@
-166,7
+167,7
@@
class RepoGroup {
$image = $image ?: false; // type sanity
# Cache file existence or non-existence
if ( $useCache && ( !$image || $image->isCacheable() ) ) {
$image = $image ?: false; // type sanity
# Cache file existence or non-existence
if ( $useCache && ( !$image || $image->isCacheable() ) ) {
- $this->cache->set
( $dbkey, $time
, $image );
+ $this->cache->set
Field( $dbkey, $timeKey
, $image );
}
return $image;
}
return $image;