public function isFresh($files, $clearstatcache = false)
    {
        if(is_array($files) === false)
        {
            $files = [ $files ];
        }

        $related = [];

        foreach($files as $file)
        {
            $related = array_merge($related, $this->getRelatedFiles($file));
        }

        $files = array_unique(array_merge($files, $related));

        $anyIsFresh = false;

        foreach($files as $file)
        {
            if($clearstatcache)
            {
                clearstatcache(false, $file);
            }

            $ct = $this->getFilemtimeCurrent($file);
            $mt = $this->getFilemtimeMetadata($file);

            if($ct > $mt)
            {
                $anyIsFresh = true;
            }

            $this->setFilemtime($file, $ct);
        }

        return $anyIsFresh;
    }
public function isFresh($files, $clearstatcache = false)
    {
        if(is_array($files) === false)
        {
            $files = [ $files ];
        }

        $related = [];

        foreach($files as $file)
        {
            $related = array_merge($related, $this->getRelatedFiles($file));
        }

        $files = array_unique(array_merge($files, $related));

        $anyIsFresh = false;

        foreach($files as $file)
        {
            if($clearstatcache)
            {
                clearstatcache(false, $file);
            }

            $ct = $this->getFilemtimeCurrent($file);
            $mt = $this->getFilemtimeMetadata($file);

            if($ct > $mt)
            {
                $anyIsFresh = true;
            }

            $this->setFilemtime($file, $ct);
        }

        return $anyIsFresh;
    }
public function isFresh ( $ files , $ clearstatcache = false ) { if ( is_array ( $ files ) === false ) { $ files = [ $ files ] ; } $ related = [ ] ; foreach ( $ files as $ file ) { $ related = array_merge ( $ related , $ this -> getRelatedFiles ( $ file ) ) ; } $ files = array_unique ( array_merge ( $ files , $ related ) ) ; $ anyIsFresh = false ; foreach ( $ files as $ file ) { if ( $ clearstatcache ) { clearstatcache ( false , $ file ) ; } $ ct = $ this -> getFilemtimeCurrent ( $ file ) ; $ mt = $ this -> getFilemtimeMetadata ( $ file ) ; if ( $ ct > $ mt ) { $ anyIsFresh = true ; } $ this -> setFilemtime ( $ file , $ ct ) ; } return $ anyIsFresh ; }
Checks if any of file is fresh.
@param  mixed  $files Filepath or array of filepaths.
@return boolean       If any of given files is not fresh, return false.
Checks if any of file is fresh .