protected function subtractBasedir($pathname, $baseDir)
    {
        $baseDir = str_replace('/', '\/', trim($baseDir, '/'));
        return trim(preg_replace(sprintf('/%s/', $baseDir), '', $pathname), '/');
    }