Kraken\_Module\Filesystem\_Abstract\FilesystemTestAbstract::getLocalData PHP Method

getLocalData() private method

private getLocalData ( $path ) : mixed[]
$path
return mixed[]
    private function getLocalData($path)
    {
        $isDir = is_dir($path);
        $local = ltrim(str_replace($this->path, '', $path), '/');
        $dirname = dirname('./' . $local . '/');
        $ext = pathinfo($path, PATHINFO_EXTENSION);
        $record = array_merge([], ['type' => $isDir ? 'dir' : 'file', 'path' => $local, 'timestamp' => filemtime($path)]);
        if (!$isDir) {
            $record = array_merge($record, ['size' => filesize($path)]);
        }
        $record = array_merge($record, ['dirname' => $dirname === '.' ? '' : ltrim($dirname, "./"), 'basename' => basename($path)]);
        if ($ext !== '') {
            $record = array_merge($record, ['extension' => $ext]);
        }
        $record = array_merge($record, ['filename' => str_replace('.' . $ext, '', basename($path))]);
        return $record;
    }