public function relative_match($url)
{
$changed = false;
$base = $this->base;
$root = $this->root;
while (0 === strpos($url, '../') && 2 <= substr_count($base, '/')) {
$changed = true;
$base = substr($base, 0, strrpos(rtrim($base, '/'), '/') + 1);
$root = substr($root, 0, strrpos(rtrim($root, '/'), '/') + 1);
$url = substr($url, 3);
}
if (!$changed || !$this->fileExists($root . $url)) {
return array(false, $url);
}
return array(true, $this->baseurl . $this->prefix . $base . $url);
}