public function computeRelativePathBetween($from, $to)
    {
        $from = $this->explodePath($from);
        $to = $this->explodePath($to);

        // Skip the common path prefix
        foreach ($from as $key => $component) {
            if (isset($to[$key]) && $to[$key] === $component) {
                unset($from[$key], $to[$key]);
            }
        }

        // Compute new realpath
        $relativePath = implode('/', $to);
        $relativePath = str_repeat('../', count($from) - 1).$relativePath;
        $relativePath = trim($relativePath, '/');

        return $relativePath;
    }