public static function folderModTime($folder, $extensionList = null)
    {
        $modTime = 0;
        if (!Filesystem::isAbsolute($folder)) {
            $folder = Director::baseFolder() . '/' . $folder;
        }

        $items = scandir($folder);
        foreach ($items as $item) {
            if ($item[0] != '.') {
                // Recurse into folders
                if (is_dir("$folder/$item")) {
                    $modTime = max($modTime, self::folderModTime("$folder/$item", $extensionList));

                // Check files
                } else {
                    $extension = null;
                    if ($extensionList) {
                        $extension = strtolower(substr($item, strrpos($item, '.')+1));
                    }
                    if (!$extensionList || in_array($extension, $extensionList)) {
                        $modTime = max($modTime, filemtime("$folder/$item"));
                    }
                }
            }
        }

        //if(!$recursiveCall) self::$cache_folderModTime[$cacheID] = $modTime;
        return $modTime;
    }
public static function folderModTime($folder, $extensionList = null)
    {
        $modTime = 0;
        if (!Filesystem::isAbsolute($folder)) {
            $folder = Director::baseFolder() . '/' . $folder;
        }

        $items = scandir($folder);
        foreach ($items as $item) {
            if ($item[0] != '.') {
                // Recurse into folders
                if (is_dir("$folder/$item")) {
                    $modTime = max($modTime, self::folderModTime("$folder/$item", $extensionList));

                // Check files
                } else {
                    $extension = null;
                    if ($extensionList) {
                        $extension = strtolower(substr($item, strrpos($item, '.')+1));
                    }
                    if (!$extensionList || in_array($extension, $extensionList)) {
                        $modTime = max($modTime, filemtime("$folder/$item"));
                    }
                }
            }
        }

        //if(!$recursiveCall) self::$cache_folderModTime[$cacheID] = $modTime;
        return $modTime;
    }
public static function folderModTime ( $ folder , $ extensionList = null ) { $ modTime = 0 ; if ( ! Filesystem :: isAbsolute ( $ folder ) ) { $ folder = Director :: baseFolder ( ) . '/' . $ folder ; } $ items = scandir ( $ folder ) ; foreach ( $ items as $ item ) { if ( $ item [ 0 ] != '.' ) { // Recurse into folders if ( is_dir ( "$folder/$item" ) ) { $ modTime = max ( $ modTime , self :: folderModTime ( "$folder/$item" , $ extensionList ) ) ; // Check files } else { $ extension = null ; if ( $ extensionList ) { $ extension = strtolower ( substr ( $ item , strrpos ( $ item , '.' ) + 1 ) ) ; } if ( ! $ extensionList || in_array ( $ extension , $ extensionList ) ) { $ modTime = max ( $ modTime , filemtime ( "$folder/$item" ) ) ; } } } } //if(!$recursiveCall) self::$cache_folderModTime[$cacheID] = $modTime; return $ modTime ; }
Return the most recent modification time of anything in the folder.

@param string $folder The folder, relative to the site root
@param array $extensionList An option array of file extensions to limit the search to
@return string Same as filemtime() format.
Return the most recent modification time of anything in the folder .