function Comparer::doTree
Parameters
mixed[] $array:
Return value
array<string, array<string, string|false>>|false
1 call to Comparer::doTree()
- Comparer::doCompare in vendor/
composer/ composer/ src/ Composer/ Package/ Comparer/ Comparer.php
File
-
vendor/
composer/ composer/ src/ Composer/ Package/ Comparer/ Comparer.php, line 124
Class
- Comparer
- class Comparer
Namespace
Composer\Package\ComparerCode
private function doTree(string $dir, array &$array) {
if ($dh = opendir($dir)) {
while ($file = readdir($dh)) {
if ($file !== '.' && $file !== '..') {
if (is_link($dir . '/' . $file)) {
$array[$dir][$file] = readlink($dir . '/' . $file);
}
elseif (is_dir($dir . '/' . $file)) {
if (!count($array)) {
$array[0] = 'Temp';
}
if (!$this->doTree($dir . '/' . $file, $array)) {
return false;
}
}
elseif (is_file($dir . '/' . $file) && filesize($dir . '/' . $file)) {
$array[$dir][$file] = hash_file(\PHP_VERSION_ID > 80100 ? 'xxh3' : 'sha1', $dir . '/' . $file);
}
}
}
if (count($array) > 1 && isset($array['0'])) {
unset($array['0']);
}
return $array;
}
return false;
}