public static function lastModifiedFolder($path)
    {
        $last_modified = 0;

        /** @var UniformResourceLocator $locator */
        $locator = Grav::instance()['locator'];
        $flags = \RecursiveDirectoryIterator::SKIP_DOTS;
        if ($locator->isStream($path)) {
            $directory = $locator->getRecursiveIterator($path, $flags);
        } else {
            $directory = new \RecursiveDirectoryIterator($path, $flags);
        }
        $filter  = new RecursiveFolderFilterIterator($directory);
        $iterator = new \RecursiveIteratorIterator($filter, \RecursiveIteratorIterator::SELF_FIRST);

        /** @var \RecursiveDirectoryIterator $file */
        foreach ($iterator as $dir) {
            $dir_modified = $dir->getMTime();
            if ($dir_modified > $last_modified) {
                $last_modified = $dir_modified;
            }
        }

        return $last_modified;
    }
public static function lastModifiedFolder($path)
    {
        $last_modified = 0;

        /** @var UniformResourceLocator $locator */
        $locator = Grav::instance()['locator'];
        $flags = \RecursiveDirectoryIterator::SKIP_DOTS;
        if ($locator->isStream($path)) {
            $directory = $locator->getRecursiveIterator($path, $flags);
        } else {
            $directory = new \RecursiveDirectoryIterator($path, $flags);
        }
        $filter  = new RecursiveFolderFilterIterator($directory);
        $iterator = new \RecursiveIteratorIterator($filter, \RecursiveIteratorIterator::SELF_FIRST);

        /** @var \RecursiveDirectoryIterator $file */
        foreach ($iterator as $dir) {
            $dir_modified = $dir->getMTime();
            if ($dir_modified > $last_modified) {
                $last_modified = $dir_modified;
            }
        }

        return $last_modified;
    }
public static function lastModifiedFolder ( $ path ) { $ last_modified = 0 ; /** @var UniformResourceLocator $locator */ $ locator = Grav :: instance ( ) [ 'locator' ] ; $ flags = \ RecursiveDirectoryIterator :: SKIP_DOTS ; if ( $ locator -> isStream ( $ path ) ) { $ directory = $ locator -> getRecursiveIterator ( $ path , $ flags ) ; } else { $ directory = new \ RecursiveDirectoryIterator ( $ path , $ flags ) ; } $ filter = new RecursiveFolderFilterIterator ( $ directory ) ; $ iterator = new \ RecursiveIteratorIterator ( $ filter , \ RecursiveIteratorIterator :: SELF_FIRST ) ; /** @var \RecursiveDirectoryIterator $file */ foreach ( $ iterator as $ dir ) { $ dir_modified = $ dir -> getMTime ( ) ; if ( $ dir_modified > $ last_modified ) { $ last_modified = $ dir_modified ; } } return $ last_modified ; }
Recursively find the last modified time under given path.

@param  string $path
@return int
Recursively find the last modified time under given path .