diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/cache/CacheDependency.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/cache/CacheDependency.php')
-rw-r--r-- | includes/cache/CacheDependency.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/includes/cache/CacheDependency.php b/includes/cache/CacheDependency.php index 9b48ecb7..517f3798 100644 --- a/includes/cache/CacheDependency.php +++ b/includes/cache/CacheDependency.php @@ -181,13 +181,11 @@ class FileDependency extends CacheDependency { function loadDependencyValues() { if ( is_null( $this->timestamp ) ) { - if ( !file_exists( $this->filename ) ) { - # Dependency on a non-existent file - # This is a valid concept! - $this->timestamp = false; - } else { - $this->timestamp = filemtime( $this->filename ); - } + wfSuppressWarnings(); + # Dependency on a non-existent file stores "false" + # This is a valid concept! + $this->timestamp = filemtime( $this->filename ); + wfRestoreWarnings(); } } @@ -195,7 +193,10 @@ class FileDependency extends CacheDependency { * @return bool */ function isExpired() { - if ( !file_exists( $this->filename ) ) { + wfSuppressWarnings(); + $lastmod = filemtime( $this->filename ); + wfRestoreWarnings(); + if ( $lastmod === false ) { if ( $this->timestamp === false ) { # Still nonexistent return false; @@ -206,7 +207,6 @@ class FileDependency extends CacheDependency { return true; } } else { - $lastmod = filemtime( $this->filename ); if ( $lastmod > $this->timestamp ) { # Modified or created wfDebug( "Dependency triggered: {$this->filename} changed.\n" ); |