private function getCommonOptions($server)
{
$options = ['host' => $server['host'], 'username' => $server['user'], 'password' => $server['pass'], 'root' => $server['path'], 'timeout' => $server['timeout'] ?: 30, 'directoryPerm' => $server['directoryPerm']];
if ($server['permissions']) {
$key = sprintf('perm%s', ucfirst($server['visibility']));
$server[$key] = $server['permissions'];
}
if ($server['permPrivate']) {
$options['permPrivate'] = intval($server['permPrivate'], 0);
}
if ($server['permPublic']) {
$options['permPublic'] = intval($server['permPublic'], 0);
}
if ($server['directoryPerm']) {
$options['directoryPerm'] = intval($server['directoryPerm'], 0);
}
return $options;
}