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();
}
}
* @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;
return true;
}
} else {
- $lastmod = filemtime( $this->filename );
if ( $lastmod > $this->timestamp ) {
# Modified or created
wfDebug( "Dependency triggered: {$this->filename} changed.\n" );