public function resolve()
{
if ($this->isAbsolute() === false) {
$this->absolutize();
}
$components = array();
foreach (explode('/', ltrim($this->components, '/')) as $component) {
switch ($component) {
case '.':
break;
case '..':
if (sizeof($components) <= 0) {
throw new exception('Unable to resolve path \'' . $this . '\'');
}
array_pop($components);
break;
default:
$components[] = $component;
}
}
$this->components = '/' . join('/', $components);
return $this;
}