Hostnet\Component\Webpack\Asset\Tracker::isOutdated PHP Method

isOutdated() public method

Returns true if the cache is outdated.
public isOutdated ( ) : boolean
return boolean true, cache is outdated of non exsitant.
    public function isOutdated()
    {
        $this->boot();
        $compiled_tracked_files = new TrackedFiles([$this->output_dir]);
        $current_tracked_files = new TrackedFiles($this->paths);
        if ($current_tracked_files->modifiedAfter($compiled_tracked_files)) {
            $this->profiler->set('tracker.reason', 'One of the tracked files has been modified.');
            return true;
        }
        $this->profiler->set('tracker.reason', false);
        return false;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param GetResponseEvent $event
  */
 public function onRequest(GetResponseEvent $event)
 {
     if (!$event->isMasterRequest()) {
         return;
     }
     if ($this->tracker->isOutdated()) {
         $this->compiler->compile();
     }
     $this->dumper->dump(new Filesystem());
 }
All Usage Examples Of Hostnet\Component\Webpack\Asset\Tracker::isOutdated