21use Wikimedia\AtEase\AtEase;
48 $this->filename = $filename;
49 $this->timestamp = $timestamp;
58 return [
'filename',
'timestamp' ];
62 if ( $this->timestamp ===
null ) {
63 AtEase::suppressWarnings();
64 # Dependency on a non-existent file stores "false"
65 # This is a valid concept!
66 $this->timestamp = filemtime( $this->filename );
67 AtEase::restoreWarnings();
75 AtEase::suppressWarnings();
76 $lastmod = filemtime( $this->filename );
77 AtEase::restoreWarnings();
78 if ( $lastmod ===
false ) {
79 if ( $this->timestamp ===
false ) {
85 wfDebug(
"Dependency triggered: {$this->filename} deleted." );
90 if ( $lastmod > $this->timestamp ) {
92 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.
loadDependencyValues()
Hook to perform any expensive pre-serialize loading of dependency values.