protected function resolvePath($path)
{
$newPath = array();
foreach (explode('/', $path) as $pathPart) {
if ('.' !== $pathPart) {
if ('..' !== $pathPart) {
$newPath[] = $pathPart;
} elseif (count($newPath) > 1) {
array_pop($newPath);
}
}
}
return implode('/', $newPath);
}