Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Port.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map;
8
9 use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map;
10 use eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest;
11
12 class Port extends Map
13 {
14 public function getName()
15 {
16 return 'port';
17 }
18
24 public function setRequest(SimplifiedRequest $request)
25 {
26 if (!$this->key) {
27 if (!empty($request->port)) {
28 $key = $request->port;
29 } else {
30 switch ($request->scheme) {
31 case 'https':
32 $key = 443;
33 break;
34
35 case 'http':
36 default:
37 $key = 80;
38 }
39 }
40
41 $this->setMapKey($key);
42 }
43
44 parent::setRequest($request);
45 }
46
47 public function reverseMatch($siteAccessName)
48 {
49 $matcher = parent::reverseMatch($siteAccessName);
50 if ($matcher instanceof self) {
51 $matcher->getRequest()->setPort($matcher->getMapKey());
52 }
53
54 return $matcher;
55 }
56 }
eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest
Definition: SimplifiedRequest.php:21
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map\Port
Definition: Port.php:13
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map\Port\getName
getName()
Returns the matcher's name.
Definition: Port.php:14
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map\Port\setRequest
setRequest(SimplifiedRequest $request)
Injects the request object to match against.
Definition: Port.php:24
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map\Port\reverseMatch
reverseMatch($siteAccessName)
Definition: Port.php:47
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map
Definition: Map.php:13
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map\setMapKey
setMapKey($key)
Injects the key that will be used for matching against the map configuration.
Definition: Map.php:78
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map\$key
$key
Definition: Map.php:19
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map\$request
$request
Definition: Map.php:36
eZ\Publish\Core\MVC\Symfony\SiteAccess\$matcher
$matcher
Definition: SiteAccess.php:37
eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\Map
Definition: Map/Host.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.