public function collectPaths($subdir = '')
{
$list = [];
$iterator = dir($this->localDir . $subdir);
$counter = 0;
while (FALSE !== ($entry = $iterator->read())) {
$this->logger->progress(str_pad(str_repeat('.', $counter++ % 40), 40));
$path = "{$this->localDir}{$subdir}/{$entry}";
$short = "{$subdir}/{$entry}";
if ($entry == '.' || $entry == '..') {
continue;
} elseif (Helpers::matchMask($short, $this->ignoreMasks, is_dir($path))) {
$this->logger->log(str_pad("Ignoring .{$short}", 40), 'gray');
continue;
} elseif (is_dir($path)) {
$list[$short . '/'] = TRUE;
$list += $this->collectPaths($short);
} elseif (is_file($path)) {
$list[$short] = Helpers::hashFile($this->preprocess($short));
}
}
$iterator->close();
return $list;
}