* fixed #194 PHP 5.6 error * - closed #102 added "set waypoint/destination" context menu to route finder module - update "Select2" 4.0.0 -> 4.0.3 - update "Font Awesome" 4.6.1 -> 4.6.3 * - added *.js files for develop branch * - closed #195 fixed "BASE" dir for subDir installations - fixed "Home" menu link * - #195 improved js load path * - added "clear cache" function for manually cache clearing to /setup #200 #105 #158 - added cache size information to /setup - added current pathfinder "VERSION" to /setup - updated "requireJs" 2.1.20 ->2.2.0 - removed unnecessary page cache timings from static templates (page cache) * - added "document_root", "port", "protocol" and "PHP framework version" to /setup page - added new "shattered" wormhole types to "signature table", closed #182, #179 * - added new "delete old signatures" option to "signature reader" dialog, closed #95 * - added new housekeeping cronjob für cached files, closed #200 - added new cache size information to /setup page * - fixed signature groupId/typeId "overwriting" for already known signatures. closed #207 - improved system search dialog. Added trim(); before "api/signatures-> search" request * updated README.me * fixed PHP error "default object from empty value", closed #209 * reduced image file size * - added local storage (IndexedDB) - added local storage for map scroll position. closed #69 * - added "notice" panel for upcoming release information - improved layout for "release dialog" (GitHub API) - improved pagespeed (removed render blocking javascripts) - improved map scrollbar configuration - improved Chrome browser custom scrollbar layout - removed "sign up" buttons from "map panels", closed #214 * - fixed some session and cookie bugs * - added new requirement check for `max_input_vars` to /setup URL, closed #224 * - fixed isWormhole(); bug * -v1.1.1 added js build files
58 lines
1.4 KiB
PHP
58 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Exodus
|
|
* Date: 25.06.2016
|
|
* Time: 16:58
|
|
*/
|
|
|
|
namespace data\filesystem;
|
|
|
|
|
|
class Search {
|
|
|
|
/**
|
|
* timestamp (seconds) filter files by mTime()
|
|
* -> default = "no filter"
|
|
* @var int
|
|
*/
|
|
static $filterTime = 0;
|
|
|
|
/**
|
|
* recursive file filter by mTime
|
|
* @param string $dir
|
|
* @param int $mTime
|
|
* @return \RecursiveIteratorIterator
|
|
*/
|
|
static function getFilesByMTime($dir, $mTime = null){
|
|
|
|
if(is_null($mTime)){
|
|
self::$filterTime = time();
|
|
}else{
|
|
self::$filterTime = (int)$mTime;
|
|
}
|
|
|
|
|
|
$directory = new \RecursiveDirectoryIterator( $dir, \FilesystemIterator::SKIP_DOTS );
|
|
$files = new \RecursiveCallbackFilterIterator($directory, function ($current, $key, $iterator) {
|
|
|
|
// Check for last modification date
|
|
/**
|
|
* @var $current \RecursiveDirectoryIterator
|
|
*/
|
|
if (
|
|
!$current->isFile() || // allow recursion
|
|
(
|
|
strpos($current->getFilename(), '.') !== 0 && // skip e.g. ".gitignore"
|
|
$current->getMTime() < self::$filterTime // check last modification date
|
|
)
|
|
){
|
|
return true;
|
|
}
|
|
return false;
|
|
});
|
|
|
|
return new \RecursiveIteratorIterator($files);
|
|
}
|
|
|
|
} |