21use Wikimedia\AtEase\AtEase;
50 $this->filename = $filename;
51 $this->timestamp = $timestamp;
60 return [
'filename',
'timestamp' ];
64 if ( $this->timestamp ===
null ) {
65 AtEase::suppressWarnings();
66 # Dependency on a non-existent file stores "false"
67 # This is a valid concept!
68 $this->timestamp = filemtime( $this->filename );
69 AtEase::restoreWarnings();
74 AtEase::suppressWarnings();
75 $lastmod = filemtime( $this->filename );
76 AtEase::restoreWarnings();
77 if ( $lastmod ===
false ) {
78 if ( $this->timestamp ===
false ) {
84 wfDebug(
"Dependency triggered: {$this->filename} deleted." );
89 if ( $lastmod > $this->timestamp ) {
91 wfDebug(
"Dependency triggered: {$this->filename} changed." );
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Base class to represent dependencies for LocalisationCache entries.
__construct( $filename, $timestamp=null)
Create a file dependency.
isExpired()
Returns true if the dependency is expired, false otherwise.
loadDependencyValues()
Hook to perform any expensive pre-serialize loading of dependency values.