@param string       $originalUrl
@param array|string $filtersOrConfigurationKey
@param array        $extraFilters

@return string
@throws \Sparwelt\ImgixLib\Exception\ResolutionException
970309
public function generateUrl($originalUrl, $filtersOrConfigurationKey = [], array $extraFilters = [])
    {
        $filters = $this->prepareFilterParams($filtersOrConfigurationKey, $extraFilters);

        return $this->urlGenerator->generateUrl($originalUrl, $filters);
    }
291320
public function getParamsFilters($additionalFields = [])
    {
        if (is_array($additionalFields) && !empty($additionalFields))
        {
            $this->filterParams = array_merge_recursive($this->filterParams, $additionalFields);
        }

        return $this->filterParams;
    }
289911
static function createExtendedAttributeFilterSQLStrings( &$extendedAttributeFilter )
    {
        $filter = array( 'tables'   => '',
                         'joins'    => '',
                         'columns'  => '',
                         'group_by' => '' );

        if ( $extendedAttributeFilter and count( $extendedAttributeFilter ) > 1 )
        {
            $extendedAttributeFilterID      = $extendedAttributeFilter['id'];
            $extendedAttributeFilterParams  = $extendedAttributeFilter['params'];
            $filterINI                      = eZINI::instance( 'extendedattributefilter.ini' );

            if ( !$filterINI->hasGroup( $extendedAttributeFilterID ) )
            {
                eZDebug::writeError( "Unable to find configuration for the extended attribute filter '$extendedAttributeFilterID', the filter will be ignored", __METHOD__ );
                return $filter;
            }

            $filterClassName    = $filterINI->variable( $extendedAttributeFilterID, 'ClassName' );
            $filterMethodName   = $filterINI->variable( $extendedAttributeFilterID, 'MethodName' );

            if ( $filterINI->hasVariable( $extendedAttributeFilterID, 'FileName' ) )
            {
                $filterFile = $filterINI->variable( $extendedAttributeFilterID, 'FileName' );

                if ( $filterINI->hasVariable( $extendedAttributeFilterID, 'ExtensionName' ) )
                {
                    $extensionName = $filterINI->variable( $extendedAttributeFilterID, 'ExtensionName' );
                    include_once( eZExtension::baseDirectory() . "/$extensionName/$filterFile" );
                }
                else
                {
                    include_once( $filterFile );
                }
            }

            if ( !class_exists( $filterClassName, true ) )
            {
                eZDebug::writeError( "Unable to find the PHP class '$filterClassName' associated with the extended attribute filter '$extendedAttributeFilterID', the filter will be ignored", __METHOD__ );
                return $filter;
            }

            $classObject        = new $filterClassName();
            $parameterArray     = array( $extendedAttributeFilterParams );

            $sqlResult          = call_user_func_array( array( $classObject, $filterMethodName ), $parameterArray );

            $filter['tables']   = $sqlResult['tables'];
            $filter['joins']    = $sqlResult['joins'];
            $filter['columns']  = isset( $sqlResult['columns'] ) ? $sqlResult['columns'] : '';

            if( isset( $sqlResult['group_by'] ) )
                $filter['group_by'] =  $sqlResult['group_by'];
        }

        return $filter;
    }
1272006
private function extractAndGroupUriFromParameters(array $requestParameters, array $filterNames)
    {
        if (empty($filterNames)) {
            return [];
        }

        $groupedUris = [];

        foreach ($this->flattenArray($requestParameters) as $key => $value) {
            $encodedUri = $this->getEncodedUri($value);

            if (in_array($key, $filterNames, true) && common_Utils::isUri($encodedUri)) {
                $groupedUris[$key][] = $encodedUri;
            }
        }

        return $groupedUris;
    }
1250404
public static Filter<FetchData> adaptFilterHttpResponse2FetchData(final Filter<HttpResponse> original) {
		return new AbstractFilter<FetchData>() {
			@Override
			public boolean apply(FetchData x) {
				return original.apply(x.response());
			}
			@Override
			public String toString() {
				return original.toString();
			}
			@Override
			public Filter<FetchData> copy() {
				return adaptFilterHttpResponse2FetchData(original.copy());
			}
		};
	}
176123
protected function getFileContent($originalFile, $cacheFile)
    {
        $this->beforeFilter($originalFile, $cacheFile);
        // Run through each filter
        foreach ($this->filters as $filterName => $Filter) {
            $arguments = isset($this->request->params[$filterName]) ?
                $this->request->params[$filterName] : array();
            if (! is_array($arguments)) {
                $arguments = array($filterName => $arguments);
            }
            // Do not minify if .min. is in the filename as it has already been minified
            if(strpos($originalFile, '.min.') !== FALSE) {
                $arguments['minify'] = false;
            }
            $Filter->doFilter($cacheFile, $arguments, $this->options);
        }

        $this->afterFilter($originalFile, $cacheFile);
        $this->lastModifiedDate = time();

        return file_get_contents($cacheFile);
    }
973661
public function setupElfinder(array $extraOptions = [])
    {
        if (!defined('ELFINDER_IMG_PARENT_URL')) {
            // Ensure images injected by elFinder are relative to its assets directory
            define('ELFINDER_IMG_PARENT_URL', $this->baseUrl(ElfinderTemplate::ELFINDER_ASSETS_REL_PATH));
        }

        $options = $this->buildConnectorOptions($extraOptions);

        // Run elFinder
        $connector = new elFinderConnector(new elFinder($options));
        $connector->run();

        return $connector;
    }
145112
public static Filter<URIResponse> adaptFilterHttpResponse2URIResponse(final Filter<HttpResponse> original) {
		return new AbstractFilter<URIResponse>() {
			@Override
			public boolean apply(URIResponse x) {
				return original.apply(x.response());
			}
			@Override
			public String toString() {
				return original.toString();
			}
			@Override
			public Filter<URIResponse> copy() {
				return adaptFilterHttpResponse2URIResponse(original.copy());
			}
		};
	}
843408
public static Filter<WarcRecord> adaptFilterHttpResponse2WarcRecord(final Filter<HttpResponse> original) {
		return new AbstractFilter<WarcRecord>() {
			@Override
			public boolean apply(WarcRecord x) {
				if (x.getWarcType() == Type.RESPONSE) return original.apply((HttpResponseWarcRecord)x);
				else return false;
			}
			@Override
			public String toString() {
				return original.toString();
			}
			@Override
			public Filter<WarcRecord> copy() {
				return adaptFilterHttpResponse2WarcRecord(original.copy());
			}
		};
	}
867998
public function filter(Url $url, ResolutionInterface $resolution, ResolutionInterface $originalResolution)
    {
        if ($resolution->getResolutionType() == ResolutionType::NOT_FOUND) {
            $parentUrl = $url->sliceSegments(0, -1);

            try {
                $parent = $this->branches->get($parentUrl);

                if ($parent instanceof PostInterface) {
                    /** @var Post $child */
                    foreach ($parent->getChildren() as $child) {
                        if ($child->getUrl()->is($url)) {
                            return new PostResolution($child);
                        }
                    }

                    /** @var File $file */
                    foreach ($parent->getAttachments() as $file) {
                        if ($file->getUrl()->is($url)) {
                            return new FileResolution($file);
                        }
                    }
                }
            } catch (NodeNotFoundException $e) {
                return $originalResolution;
            }
        }

        return $originalResolution;
    }
1323551
private URL getCleanedUrl(URL originalUrl,
            String originalPath) {
        try {
            return new URL(StringUtils.cleanPath(originalPath));
        } catch (MalformedURLException ex) {
            // Cleaned URL path cannot be converted to URL
            // -> take original URL.
            return originalUrl;
        }
    }
178343
private function setExtensionConfigurationKeyForRewriter(
        ContainerBuilder $container,
        $rewriterServiceId,
        $extensionConfigKey
    ) {
        $rewriterDefinition = $container->getDefinition($rewriterServiceId);

        $methodCalls = $rewriterDefinition->getMethodCalls();

        $methodCalls[] = ['setExtensionConfigurationKey', [$extensionConfigKey]];

        $rewriterDefinition->setMethodCalls($methodCalls);
    }
826561
public function storageUrl($image, ?string $alt = null, array $extra = []): ?string
    {
        return $this->generateImagePayload($image, $alt, $extra, true, true)->url ?? null;
    }
1279486
public function setAdditionalFilters($additionalFilters)
    {
        $path = $this->prefixWithNamespace('additionalFilters');
        $this->argumentsAccessor->set($path, $additionalFilters);
        $this->stateChanged = true;

        return $this;
    }
692547
public function resolve(Closure $originalResolver, string $path)
    {
        $isDeferred = $this->isDeferred($path);
        $resolver = $isDeferred
            ? $this->deferred[$path]
            : $originalResolver;

        if ($isDeferred) {
            $this->resolved[] = $path;

            unset($this->deferred[$path]);
        }

        return $resolver();
    }
195778
public function getCdnForImage($originalUr)
    {
        if (0 === strpos($originalUr, 'data:')) {
            throw new ResolutionException('Encoded image are not resolvable');
        }

        foreach ($this->cdnConfigurations as $configuration) {
            $originalPath = parse_url($originalUr, PHP_URL_PATH);
            $originalHost = parse_url($originalUr, PHP_URL_HOST);

            if (null === $originalPath) {
                throw new ResolutionException('Image has no path');
            }

            if (!$this->isDomainMatch($originalHost, $configuration->getSourceDomains())) {
                continue;
            }

            if (!$this->isPatternMatch($configuration, $originalPath)) {
                continue;
            }

            return $configuration;
        }

        throw new ResolutionException(sprintf('Cannot find cdn configuration match for image %s', $originalUr));
    }
1332414
public function write(string $originalFileName, int $lifetime, string $originalContent)
    {
        $configuration = GeneralUtility::makeInstance(ConfigurationService::class);
        $tagService = GeneralUtility::makeInstance(TagService::class);

        $fileName = PathUtility::pathinfo($originalFileName, PATHINFO_DIRNAME) . '/.htaccess';
        $accessTimeout = (int)$configuration->get('htaccessTimeout');
        $lifetime = $accessTimeout ? $accessTimeout : $lifetime;

        $tags = $tagService->isEnable() ? $tagService->getTags() : [];

        $variables = [
            'mode' => $accessTimeout ? 'A' : 'M',
            'lifetime' => $lifetime,
            'expires' => (new DateTimeService())->getCurrentTime() + $lifetime,
            'typo3headers' => GeneralUtility::makeInstance(TypoScriptFrontendService::class)->getAdditionalHeaders(),
            'sendCacheControlHeader' => $configuration->isBool('sendCacheControlHeader'),
            'sendCacheControlHeaderRedirectAfterCacheTimeout' => $configuration->isBool('sendCacheControlHeaderRedirectAfterCacheTimeout'),
            'sendTypo3Headers' => $configuration->isBool('sendTypo3Headers'),
            'tags' => \implode(',', $tags),
            'tagHeaderName' => $tagService->getHeaderName(),
            'sendStaticFileCacheHeader' => $configuration->isBool('sendStaticFileCacheHeader'),
            'httpPushHeaders' => GeneralUtility::makeInstance(HttpPushService::class)->getHttpPushHeaders($originalContent),
        ];

        $this->renderTemplateToFile($this->getTemplateName(), $variables, $fileName);
    }