allow getting acls of files

This commit is contained in:
Robin Appelman 2020-02-10 15:52:48 +01:00
commit 3c5e45dc54
12 changed files with 237 additions and 13 deletions

View file

@ -150,7 +150,7 @@ class Parser {
];
}
public function parseDir($output, $basePath) {
public function parseDir($output, $basePath, callable $aclCallback) {
//last line is used space
array_pop($output);
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARS]*)\s+)?([0-9]+)\s+(.*)$/';
@ -162,7 +162,10 @@ class Parser {
if ($name !== '.' and $name !== '..') {
$mode = $this->parseMode($mode);
$time = strtotime($time . ' ' . $this->timeZone);
$content[] = new FileInfo($basePath . '/' . $name, $name, $size, $time, $mode);
$path = $basePath . '/' . $name;
$content[] = new FileInfo($path, $name, $size, $time, $mode, function () use ($aclCallback, $path) {
return $aclCallback($path);
});
}
}
}