Compare commits
No commits in common. "master" and "v1.7.2" have entirely different histories.
|
@ -1,5 +0,0 @@
|
||||||
## v1.8.1
|
|
||||||
- Adding null check in need_to_regen_any(..)
|
|
||||||
|
|
||||||
## v1.7.2
|
|
||||||
- Fixing weird lstat bug on Windows for rrmdir function for large amount of directory items
|
|
|
@ -87,6 +87,8 @@ function find_files(string $dir, array $fnmatch_patterns = []) : array
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//obsolete, use find_files instead
|
||||||
function scan_files_rec(array $dirs, array $only_extensions = [], int $mode = 1) : array
|
function scan_files_rec(array $dirs, array $only_extensions = [], int $mode = 1) : array
|
||||||
{
|
{
|
||||||
$files = array();
|
$files = array();
|
||||||
|
@ -166,7 +168,7 @@ function json_make_pretty(string $json) : string
|
||||||
return prettyJSON($json);
|
return prettyJSON($json);
|
||||||
}
|
}
|
||||||
|
|
||||||
function need_to_regen(string $file, iterable $deps, bool $debug = false) : bool
|
function need_to_regen(string $file, array $deps, bool $debug = false) : bool
|
||||||
{
|
{
|
||||||
if(!is_file($file))
|
if(!is_file($file))
|
||||||
{
|
{
|
||||||
|
@ -176,7 +178,6 @@ function need_to_regen(string $file, iterable $deps, bool $debug = false) : bool
|
||||||
}
|
}
|
||||||
|
|
||||||
$fmtime = filemtime($file);
|
$fmtime = filemtime($file);
|
||||||
|
|
||||||
foreach($deps as $dep)
|
foreach($deps as $dep)
|
||||||
{
|
{
|
||||||
if($dep && is_file($dep) && (filemtime($dep) > $fmtime))
|
if($dep && is_file($dep) && (filemtime($dep) > $fmtime))
|
||||||
|
@ -214,9 +215,6 @@ function need_to_regen_any(array $files, array $deps, bool $debug = false) : boo
|
||||||
echo "need_to_regen_any, earliest file: $earliest_file ($date)\n";
|
echo "need_to_regen_any, earliest file: $earliest_file ($date)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($earliest_file === null)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return need_to_regen($earliest_file, $deps, $debug);
|
return need_to_regen($earliest_file, $deps, $debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,12 +1191,12 @@ function are_you_sure_ask() : bool
|
||||||
return $resp == "YES";
|
return $resp == "YES";
|
||||||
}
|
}
|
||||||
|
|
||||||
function names_hash_changed(string $crc_file, iterable $names) : bool
|
function names_hash_changed(string $crc_file, array $names) : bool
|
||||||
{
|
{
|
||||||
$ctx = hash_init('crc32');
|
$ctx = hash_init('crc32');
|
||||||
foreach($names as $name)
|
foreach($names as $name)
|
||||||
hash_update($ctx, $name);
|
hash_update($ctx, $name);
|
||||||
$names_crc = hash_final($ctx, false);
|
$names_crc = hash_final($ctx, true);
|
||||||
$changed = !file_exists($crc_file) || ensure_read($crc_file) != $names_crc;
|
$changed = !file_exists($crc_file) || ensure_read($crc_file) != $names_crc;
|
||||||
ensure_write($crc_file, $names_crc);
|
ensure_write($crc_file, $names_crc);
|
||||||
return $changed;
|
return $changed;
|
||||||
|
|
Loading…
Reference in New Issue