lib/Util/Archive/FileAdder.php
protected function subtractBasedir($pathname, $baseDir)
    {
        $baseDir = str_replace('/', '\/', trim($baseDir, '/'));
        return trim(preg_replace(sprintf('/%s/', $baseDir), '', $pathname), '/');
    }
protected function subtractBasedir($pathname, $baseDir)
    {
        $baseDir = str_replace('/', '\/', trim($baseDir, '/'));
        return trim(preg_replace(sprintf('/%s/', $baseDir), '', $pathname), '/');
    }
protected function subtractBasedir ( $ pathname , $ baseDir ) { $ baseDir = str_replace ( '/' , '\/' , trim ( $ baseDir , '/' ) ) ; return trim ( preg_replace ( sprintf ( '/%s/' , $ baseDir ) , '' , $ pathname ) , '/' ) ; }
Subtract baseDir from pathname

@param string $pathname The full pathname
@param string $baseDir The base pathname within pathname

@return string Subdir portion, slashes cut off on both sides
Subtract baseDir from pathname