protected function extractPathFromBasePath($path, $options)
    {
        if (isset($options[self::KEY_BASE_PATH])) {
            $pos = strpos($path, $options[self::KEY_BASE_PATH]);
            if (false !== $pos) {
                $path = substr($path, $pos + strlen($options[self::KEY_BASE_PATH]));
            }
        }
        // ensure the path has a leading slash
        if (empty($path) || $path[0] !== '/') {
            $path = '/'.$path;
        }
        return $path;
    }