Hypernode\Magento\Command\Hypernode\Performance\PerformanceCommand::replaceUrl PHP Method

replaceUrl() protected method

Replaces the URL by a regex strip.
protected replaceUrl ( $sitemapUrl, $replaceUrl ) : string
$sitemapUrl
$replaceUrl
return string
    protected function replaceUrl($sitemapUrl, $replaceUrl)
    {
        $strippedUrl = $this->getStrippedUrl($sitemapUrl);
        $parts = explode($strippedUrl, $sitemapUrl);
        $url = rtrim($replaceUrl, "/");
        $path = ltrim(end($parts), "/");
        return $url . "/" . $path;
    }