X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FCacheTime.php;h=6fb3e0a820181e6307cc386e407abae59addbebb;hb=7665f7d7674dbdf785c71ddafce0721a2e130cf3;hp=dfe3c800b59bebd2c2e8cbaed0a62a842e05e776;hpb=79ebb4b0288b709fb53cff8f7ebc5f50221931c9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/CacheTime.php b/includes/parser/CacheTime.php index dfe3c800b5..6fb3e0a820 100644 --- a/includes/parser/CacheTime.php +++ b/includes/parser/CacheTime.php @@ -53,7 +53,7 @@ class CacheTime { } /** - * @param $com bool + * @param bool $com * @return bool */ function setContainsOldMagic( $com ) { @@ -63,7 +63,7 @@ class CacheTime { /** * setCacheTime() sets the timestamp expressing when the page has been rendered. * This does not control expiry, see updateCacheExpiry() for that! - * @param $t string + * @param string $t * @return string */ function setCacheTime( $t ) { @@ -80,7 +80,7 @@ class CacheTime { /** * @since 1.23 - * @param $id int Revision id + * @param int $id Revision id */ function setCacheRevisionId( $id ) { $this->mCacheRevisionId = $id; @@ -94,7 +94,7 @@ class CacheTime { * or equal to the smallest number that was provided as an argument to * updateCacheExpiry(). * - * @param $seconds number + * @param int $seconds */ function updateCacheExpiry( $seconds ) { $seconds = (int)$seconds; @@ -156,17 +156,19 @@ class CacheTime { * per-article cache invalidation timestamps, or if it comes from * an incompatible older version. * - * @param string $touched the affected article's last touched timestamp - * @return Boolean + * @param string $touched The affected article's last touched timestamp + * @return bool */ public function expired( $touched ) { global $wgCacheEpoch; - return !$this->isCacheable() || // parser says it's uncacheable - $this->getCacheTime() < $touched || - $this->getCacheTime() <= $wgCacheEpoch || - $this->getCacheTime() < wfTimestamp( TS_MW, time() - $this->getCacheExpiry() ) || // expiry period has passed - !isset( $this->mVersion ) || - version_compare( $this->mVersion, Parser::VERSION, "lt" ); + + return !$this->isCacheable() // parser says it's uncacheable + || $this->getCacheTime() < $touched + || $this->getCacheTime() <= $wgCacheEpoch + || $this->getCacheTime() < + wfTimestamp( TS_MW, time() - $this->getCacheExpiry() ) // expiry period has passed + || !isset( $this->mVersion ) + || version_compare( $this->mVersion, Parser::VERSION, "lt" ); } /** @@ -178,8 +180,8 @@ class CacheTime { * deployed. Someday that should probably be changed. * * @since 1.23 - * @param int $id the affected article's current revision id - * @return Boolean + * @param int $id The affected article's current revision id + * @return bool */ public function isDifferentRevision( $id ) { $cached = $this->getCacheRevisionId();