-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add resolutionHost
option
#3
Open
j6s
wants to merge
11
commits into
Flowpack:master
Choose a base branch
from
MarcoPNS:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ae88949
added new option resolutionHost
MarcoPNS b3b34f7
edited docuentation and renamed it for github
MarcoPNS 8b536bd
added missing Syntax highlighting in readme file
MarcoPNS 33436c7
Merge remote-tracking branch 'upstream/master'
MarcoPNS 0c4f9e4
Merge pull request #1 from Flowpack/master
MarcoPNS 0d0ce64
host can be used with uriPathSegment
MarcoPNS e5b05a7
Switched to PSR-15 middleware for Neos 7.0
MarcoPNS a0f2334
renamed DetectContentSubgraphComponent
MarcoPNS 5216ace
renamed SubgraphMiddleware file
MarcoPNS 6b601f3
Fix for PSR-7 v2
MarcoPNS 3afe9a2
Merge branch 'master'
MarcoPNS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
*.DS_Store | ||
.idea/ | ||
Documentation/* | ||
!Documentation/*.rst | ||
|
||
.idea/ |
Empty file modified
0
Classes/Http/ContentDimensionDetection/BackendUriDimensionPresetDetector.php
100644 → 100755
Empty file.
Empty file modified
0
Classes/Http/ContentDimensionDetection/ContentDimensionPresetDetectorInterface.php
100644 → 100755
Empty file.
Empty file modified
0
Classes/Http/ContentDimensionDetection/DimensionPresetDetectorResolver.php
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file modified
0
Classes/Http/ContentDimensionDetection/UriPathSegmentDimensionPresetDetector.php
100644 → 100755
Empty file.
Empty file modified
0
Classes/Http/ContentDimensionLinking/ContentDimensionPresetLinkProcessorInterface.php
100644 → 100755
Empty file.
Empty file modified
0
Classes/Http/ContentDimensionLinking/DimensionPresetLinkProcessorResolver.php
100644 → 100755
Empty file.
Empty file modified
0
Classes/Http/ContentDimensionLinking/NullDimensionPresetLinkProcessor.php
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file modified
0
Classes/Http/Exception/InvalidDimensionPresetDetectorException.php
100644 → 100755
Empty file.
Empty file modified
0
Classes/Http/Exception/InvalidDimensionPresetLinkProcessorException.php
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,7 @@ protected function matchValue($requestPath) | |
|
||
$tagArray = [$contentContext->getWorkspace()->getName(), $node->getIdentifier()]; | ||
$parent = $node->getParent(); | ||
|
||
while ($parent) { | ||
$tagArray[] = $parent->getIdentifier(); | ||
$parent = $parent->getParent(); | ||
|
@@ -197,8 +198,7 @@ protected function convertRequestPathToNode($requestPath) | |
if ($requestPathWithoutContext === '') { | ||
$node = $siteNode; | ||
} else { | ||
$relativeNodePath = $this->getRelativeNodePathByUriPathSegmentProperties($siteNode, $requestPathWithoutContext); | ||
$node = ($relativeNodePath !== false) ? $siteNode->getNode($relativeNodePath) : null; | ||
$node = $this->getNodeFromRequestPath($siteNode, $requestPathWithoutContext) ?? null; | ||
} | ||
|
||
if (!$node instanceof NodeInterface) { | ||
|
@@ -409,8 +409,7 @@ protected function resolveRoutePathForNode(NodeInterface $node) | |
$nodeContextPathSuffix = ($workspaceName !== 'live') ? substr($nodeContextPath, strpos($nodeContextPath, '@')) : ''; | ||
|
||
$requestPath = $this->getRequestPathByNode($node); | ||
|
||
return trim($requestPath, '/') . $nodeContextPathSuffix; | ||
return $requestPath . $nodeContextPathSuffix; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? |
||
} | ||
|
||
/** | ||
|
@@ -422,6 +421,7 @@ protected function resolveRoutePathForNode(NodeInterface $node) | |
* | ||
* @param NodeInterface $siteNode The site node, used as a starting point while traversing the tree | ||
* @param string $relativeRequestPath The request path, relative to the site's root path | ||
* @deprecated Use getNodeFromRequestPath() - return only the node | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? |
||
* @return string | ||
* @throws \Neos\ContentRepository\Exception\NodeException | ||
*/ | ||
|
@@ -448,6 +448,37 @@ protected function getRelativeNodePathByUriPathSegmentProperties(NodeInterface $ | |
return implode('/', $relativeNodePathSegments); | ||
} | ||
|
||
/** | ||
* Return Node from RequestPath | ||
* | ||
* @param NodeInterface $siteNode The site node, used as a starting point while traversing the tree | ||
* @param string $relativeRequestPath The request path, relative to the site's root path | ||
* @return NodeInterface | ||
* @throws \Neos\ContentRepository\Exception\NodeException | ||
*/ | ||
protected function getNodeFromRequestPath(NodeInterface $siteNode, $relativeRequestPath) | ||
{ | ||
$matchedNode = false; | ||
$node = $siteNode; | ||
|
||
foreach (explode('/', $relativeRequestPath) as $pathSegment) { | ||
$foundNodeInThisSegment = false; | ||
foreach ($node->getChildNodes('Neos.Neos:Document') as $node) { | ||
/** @var NodeInterface $node */ | ||
if ($node->getProperty('uriPathSegment') === $pathSegment) { | ||
$matchedNode = $node; | ||
$foundNodeInThisSegment = true; | ||
break; | ||
} | ||
} | ||
if (!$foundNodeInThisSegment) { | ||
return false; | ||
} | ||
} | ||
|
||
return $matchedNode; | ||
} | ||
|
||
/** | ||
* Renders a request path based on the "uriPathSegment" properties of the nodes leading to the given node. | ||
* | ||
|
@@ -482,6 +513,6 @@ protected function getRequestPathByNode(NodeInterface $node) | |
$currentNode = $currentNode->getParent(); | ||
} | ||
|
||
return implode('/', array_reverse($requestPathSegments)); | ||
return '/' . implode('/', array_reverse($requestPathSegments)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? |
||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will conflict with #11 I think. Just pointing this out already…