public static function getTransformPathForUrl($url): string
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        $urlParts = parse_url($url);
        $pathParts = pathinfo($urlParts['path']);
        $hashRemoteUrl = $config->getSetting('hashRemoteUrl');
        $hashPath = $config->getSetting('hashPath');
        $shortHashLength = $config->getSetting('shortHashLength');
        $transformPath = $pathParts['dirname'];

        if ($hashPath) {
            $transformPath = '/' . md5($pathParts['dirname']);
        }

        if ($hashRemoteUrl) {
            if (\is_string($hashRemoteUrl) && $hashRemoteUrl === 'host') {
                $transformPath = '/' . substr(md5($urlParts['host']), 0, $shortHashLength) . $transformPath;
            } else {
                $transformPath = '/' . md5($urlParts['host'] . $pathParts['dirname']);
            }
        } else {
            $transformPath = '/' . str_replace('.', '_', $urlParts['host']) . $transformPath;
        }

        return FileHelper::normalizePath($transformPath);
    }
public static function getTransformPathForUrl($url): string
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        $urlParts = parse_url($url);
        $pathParts = pathinfo($urlParts['path']);
        $hashRemoteUrl = $config->getSetting('hashRemoteUrl');
        $hashPath = $config->getSetting('hashPath');
        $shortHashLength = $config->getSetting('shortHashLength');
        $transformPath = $pathParts['dirname'];

        if ($hashPath) {
            $transformPath = '/' . md5($pathParts['dirname']);
        }

        if ($hashRemoteUrl) {
            if (\is_string($hashRemoteUrl) && $hashRemoteUrl === 'host') {
                $transformPath = '/' . substr(md5($urlParts['host']), 0, $shortHashLength) . $transformPath;
            } else {
                $transformPath = '/' . md5($urlParts['host'] . $pathParts['dirname']);
            }
        } else {
            $transformPath = '/' . str_replace('.', '_', $urlParts['host']) . $transformPath;
        }

        return FileHelper::normalizePath($transformPath);
    }
public static function getTransformPathForUrl ( $ url ) : string { /** @var ConfigModel $settings */ $ config = ImagerService :: getConfig ( ) ; $ urlParts = parse_url ( $ url ) ; $ pathParts = pathinfo ( $ urlParts [ 'path' ] ) ; $ hashRemoteUrl = $ config -> getSetting ( 'hashRemoteUrl' ) ; $ hashPath = $ config -> getSetting ( 'hashPath' ) ; $ shortHashLength = $ config -> getSetting ( 'shortHashLength' ) ; $ transformPath = $ pathParts [ 'dirname' ] ; if ( $ hashPath ) { $ transformPath = '/' . md5 ( $ pathParts [ 'dirname' ] ) ; } if ( $ hashRemoteUrl ) { if ( \ is_string ( $ hashRemoteUrl ) && $ hashRemoteUrl === 'host' ) { $ transformPath = '/' . substr ( md5 ( $ urlParts [ 'host' ] ) , 0 , $ shortHashLength ) . $ transformPath ; } else { $ transformPath = '/' . md5 ( $ urlParts [ 'host' ] . $ pathParts [ 'dirname' ] ) ; } } else { $ transformPath = '/' . str_replace ( '.' , '_' , $ urlParts [ 'host' ] ) . $ transformPath ; } return FileHelper :: normalizePath ( $ transformPath ) ; }
Returns the transform path for a given url.

@param $url

@return string
Returns the transform path for a given url .