src/Sulu/Component/Webspace/Analyzer/Attributes/PortalInformationRequestProcessor.php
private function getResourceLocatorFromRequest(PortalInformation $portalInformation, Request $request, $path)
    {
        // extract file and extension info
        $pathParts = explode('/', $path);
        $fileInfo = explode('.', array_pop($pathParts));

        $path = rtrim(implode('/', $pathParts), '/') . '/' . $fileInfo[0];
        $formatResult = null;
        if (count($fileInfo) > 1) {
            $formatResult = end($fileInfo);
        }

        $resourceLocator = substr(
            $request->getHost() . $path,
            strlen($portalInformation->getUrl())
        );

        return [$resourceLocator, $formatResult];
    }
private function getResourceLocatorFromRequest(PortalInformation $portalInformation, Request $request, $path)
    {
        // extract file and extension info
        $pathParts = explode('/', $path);
        $fileInfo = explode('.', array_pop($pathParts));

        $path = rtrim(implode('/', $pathParts), '/') . '/' . $fileInfo[0];
        $formatResult = null;
        if (count($fileInfo) > 1) {
            $formatResult = end($fileInfo);
        }

        $resourceLocator = substr(
            $request->getHost() . $path,
            strlen($portalInformation->getUrl())
        );

        return [$resourceLocator, $formatResult];
    }
private function getResourceLocatorFromRequest ( PortalInformation $ portalInformation , Request $ request , $ path ) { // extract file and extension info $ pathParts = explode ( '/' , $ path ) ; $ fileInfo = explode ( '.' , array_pop ( $ pathParts ) ) ; $ path = rtrim ( implode ( '/' , $ pathParts ) , '/' ) . '/' . $ fileInfo [ 0 ] ; $ formatResult = null ; if ( count ( $ fileInfo ) > 1 ) { $ formatResult = end ( $ fileInfo ) ; } $ resourceLocator = substr ( $ request -> getHost ( ) . $ path , strlen ( $ portalInformation -> getUrl ( ) ) ) ; return [ $ resourceLocator , $ formatResult ] ; }
Returns resource locator and format of current request.

@param PortalInformation $portalInformation
@param Request $request
@param string $path

@return array
Returns resource locator and format of current request .