7use Wikimedia\AtEase\AtEase;
36 $this->filename = $filename;
37 $this->timestamp = $timestamp;
46 return [
'filename',
'timestamp' ];
50 if ( $this->timestamp ===
null ) {
51 AtEase::suppressWarnings();
52 # Dependency on a non-existent file stores "false"
53 # This is a valid concept!
54 $this->timestamp = filemtime( $this->filename );
55 AtEase::restoreWarnings();
61 AtEase::suppressWarnings();
62 $lastmod = filemtime( $this->filename );
63 AtEase::restoreWarnings();
64 if ( $lastmod ===
false ) {
65 if ( $this->timestamp ===
false ) {
71 wfDebug(
"Dependency triggered: {$this->filename} deleted." );
76 if ( $lastmod > $this->timestamp ) {
78 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.bool
loadDependencyValues()
Hook to perform any expensive pre-serialize loading of dependency values.