Neos.Neos/Classes/Routing/FrontendNodeRoutePartHandler.php
protected function parseDimensionsAndNodePathFromRequestPathAllowingEmptySegment(&$requestPath)
    {
        $dimensionPresets = $this->contentDimensionPresetSource->getAllPresets();
        if (count($dimensionPresets) === 0) {
            return [];
        }
        $dimensionsAndDimensionValues = [];
        $chosenDimensionPresets = [];
        $matches = [];
        preg_match(self::DIMENSION_REQUEST_PATH_MATCHER, $requestPath, $matches);
        $firstUriPartIsValidDimension = true;
        foreach ($dimensionPresets as $dimensionName => $dimensionPreset) {
            $dimensionsAndDimensionValues[$dimensionName] = $dimensionPreset['presets'][$dimensionPreset['defaultPreset']]['values'];
            $chosenDimensionPresets[$dimensionName] = $dimensionPreset['defaultPreset'];
        }
        if (isset($matches['firstUriPart'])) {
            $firstUriPartExploded = explode('_', $matches['firstUriPart']);
            foreach ($firstUriPartExploded as $uriSegment) {
                $uriSegmentIsValid = false;
                foreach ($dimensionPresets as $dimensionName => $dimensionPreset) {
                    $preset = $this->contentDimensionPresetSource->findPresetByUriSegment($dimensionName, $uriSegment);
                    if ($preset !== null) {
                        $uriSegmentIsValid = true;
                        $dimensionsAndDimensionValues[$dimensionName] = $preset['values'];
                        $chosenDimensionPresets[$dimensionName] = $preset['identifier'];
                        break;
                    }
                }
                if (!$uriSegmentIsValid) {
                    $firstUriPartIsValidDimension = false;
                    break;
                }
            }
            if ($firstUriPartIsValidDimension) {
                $requestPath = (isset($matches['remainingRequestPath']) ? $matches['remainingRequestPath'] : '');
            }
        }
        if (!$this->contentDimensionPresetSource->isPresetCombinationAllowedByConstraints($chosenDimensionPresets)) {
            throw new InvalidDimensionPresetCombinationException(sprintf('The resolved content dimension preset combination (%s) is invalid or restricted by content dimension constraints. Check your content dimension settings if you think that this is an error.', implode(', ', array_keys($chosenDimensionPresets))), 1428657721);
        }
        return $dimensionsAndDimensionValues;
    }
protected function parseDimensionsAndNodePathFromRequestPathAllowingEmptySegment(&$requestPath)
    {
        $dimensionPresets = $this->contentDimensionPresetSource->getAllPresets();
        if (count($dimensionPresets) === 0) {
            return [];
        }
        $dimensionsAndDimensionValues = [];
        $chosenDimensionPresets = [];
        $matches = [];
        preg_match(self::DIMENSION_REQUEST_PATH_MATCHER, $requestPath, $matches);
        $firstUriPartIsValidDimension = true;
        foreach ($dimensionPresets as $dimensionName => $dimensionPreset) {
            $dimensionsAndDimensionValues[$dimensionName] = $dimensionPreset['presets'][$dimensionPreset['defaultPreset']]['values'];
            $chosenDimensionPresets[$dimensionName] = $dimensionPreset['defaultPreset'];
        }
        if (isset($matches['firstUriPart'])) {
            $firstUriPartExploded = explode('_', $matches['firstUriPart']);
            foreach ($firstUriPartExploded as $uriSegment) {
                $uriSegmentIsValid = false;
                foreach ($dimensionPresets as $dimensionName => $dimensionPreset) {
                    $preset = $this->contentDimensionPresetSource->findPresetByUriSegment($dimensionName, $uriSegment);
                    if ($preset !== null) {
                        $uriSegmentIsValid = true;
                        $dimensionsAndDimensionValues[$dimensionName] = $preset['values'];
                        $chosenDimensionPresets[$dimensionName] = $preset['identifier'];
                        break;
                    }
                }
                if (!$uriSegmentIsValid) {
                    $firstUriPartIsValidDimension = false;
                    break;
                }
            }
            if ($firstUriPartIsValidDimension) {
                $requestPath = (isset($matches['remainingRequestPath']) ? $matches['remainingRequestPath'] : '');
            }
        }
        if (!$this->contentDimensionPresetSource->isPresetCombinationAllowedByConstraints($chosenDimensionPresets)) {
            throw new InvalidDimensionPresetCombinationException(sprintf('The resolved content dimension preset combination (%s) is invalid or restricted by content dimension constraints. Check your content dimension settings if you think that this is an error.', implode(', ', array_keys($chosenDimensionPresets))), 1428657721);
        }
        return $dimensionsAndDimensionValues;
    }
protected function parseDimensionsAndNodePathFromRequestPathAllowingEmptySegment ( & $ requestPath ) { $ dimensionPresets = $ this -> contentDimensionPresetSource -> getAllPresets ( ) ; if ( count ( $ dimensionPresets ) === 0 ) { return [ ] ; } $ dimensionsAndDimensionValues = [ ] ; $ chosenDimensionPresets = [ ] ; $ matches = [ ] ; preg_match ( self :: DIMENSION_REQUEST_PATH_MATCHER , $ requestPath , $ matches ) ; $ firstUriPartIsValidDimension = true ; foreach ( $ dimensionPresets as $ dimensionName => $ dimensionPreset ) { $ dimensionsAndDimensionValues [ $ dimensionName ] = $ dimensionPreset [ 'presets' ] [ $ dimensionPreset [ 'defaultPreset' ] ] [ 'values' ] ; $ chosenDimensionPresets [ $ dimensionName ] = $ dimensionPreset [ 'defaultPreset' ] ; } if ( isset ( $ matches [ 'firstUriPart' ] ) ) { $ firstUriPartExploded = explode ( '_' , $ matches [ 'firstUriPart' ] ) ; foreach ( $ firstUriPartExploded as $ uriSegment ) { $ uriSegmentIsValid = false ; foreach ( $ dimensionPresets as $ dimensionName => $ dimensionPreset ) { $ preset = $ this -> contentDimensionPresetSource -> findPresetByUriSegment ( $ dimensionName , $ uriSegment ) ; if ( $ preset !== null ) { $ uriSegmentIsValid = true ; $ dimensionsAndDimensionValues [ $ dimensionName ] = $ preset [ 'values' ] ; $ chosenDimensionPresets [ $ dimensionName ] = $ preset [ 'identifier' ] ; break ; } } if ( ! $ uriSegmentIsValid ) { $ firstUriPartIsValidDimension = false ; break ; } } if ( $ firstUriPartIsValidDimension ) { $ requestPath = ( isset ( $ matches [ 'remainingRequestPath' ] ) ? $ matches [ 'remainingRequestPath' ] : '' ) ; } } if ( ! $ this -> contentDimensionPresetSource -> isPresetCombinationAllowedByConstraints ( $ chosenDimensionPresets ) ) { throw new InvalidDimensionPresetCombinationException ( sprintf ( 'The resolved content dimension preset combination (%s) is invalid or restricted by content dimension constraints. Check your content dimension settings if you think that this is an error.' , implode ( ', ' , array_keys ( $ chosenDimensionPresets ) ) ) , 1428657721 ) ; } return $ dimensionsAndDimensionValues ; }
Parses the given request path and checks if the first path segment is one or a set of content dimension preset
identifiers. If that is the case, the return value is an array of dimension names and their preset URI segments.
Allows uriSegment to be empty for default dimension preset.

If the first path segment contained content dimension information, it is removed from &$requestPath.

@param string &$requestPath The request path currently being processed by this route part handler, e.g. "de_global/startseite/ueber-uns"
@return array An array of dimension name => dimension values (array of string)
@throws InvalidDimensionPresetCombinationException
Parses the given request path and checks if the first path segment is one or a set of content dimension preset identifiers . If that is the case the return value is an array of dimension names and their preset URI segments . Allows uriSegment to be empty for default dimension preset .