Skip to content

Commit

Permalink
TASK: Rename getHostPatterns to getHostnames
Browse files Browse the repository at this point in the history
This is related to a change in Neos (PR #606). Since 2013 the hostPattern
no longer supported using a wildcard.

This change renames getHostPatterns to getHostnames. It therefore makes
things clearer.
  • Loading branch information
kdambekalns authored and gerhard-boden committed Nov 16, 2017
1 parent 3089dda commit a43f8b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Classes/Service/NodeRedirectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function createRedirectsForPublishedNode(NodeInterface $node, Workspace $
throw new Exception('The target URI path of the node could not be resolved', 1451945358);
}

$hosts = $this->getHostPatterns($node->getContext());
$hosts = $this->getHostnames($node->getContext());

// The page has been removed
if ($node->isRemoved()) {
Expand Down Expand Up @@ -142,17 +142,19 @@ public function createRedirectsForPublishedNode(NodeInterface $node, Workspace $
}

/**
* Collects all hostnames from the Domain entries attached to the current site.
*
* @param ContentContext $contentContext
* @return array
*/
protected function getHostPatterns(ContentContext $contentContext)
protected function getHostnames(ContentContext $contentContext)
{
$site = $contentContext->getCurrentSite();
$domains = [];
if ($site !== null) {
foreach ($site->getDomains() as $domain) {
/** @var Domain $domain */
$domains[] = $domain->getHostPattern();
$domains[] = $domain->getHostname();
}
}
return $domains;
Expand Down

0 comments on commit a43f8b3

Please sign in to comment.