Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
RedirectableUrlMatcher.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Routing\Matcher;
13
14 use Symfony\Component\Routing\Exception\ResourceNotFoundException;
15 use Symfony\Component\Routing\Route;
16
17 /**
18 * @author Fabien Potencier <fabien@symfony.com>
19 */
20 abstract class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface
21 {
22 /**
23 * {@inheritdoc}
24 */
25 public function match($pathinfo)
26 {
27 try {
28 $parameters = parent::match($pathinfo);
29 } catch (ResourceNotFoundException $e) {
30 if ('/' === substr($pathinfo, -1) || !\in_array($this->context->getMethod(), ['HEAD', 'GET'])) {
31 throw $e;
32 }
33
34 try {
35 $parameters = parent::match($pathinfo.'/');
36
37 return array_replace($parameters, $this->redirect($pathinfo.'/', isset($parameters['_route']) ? $parameters['_route'] : null));
38 } catch (ResourceNotFoundException $e2) {
39 throw $e;
40 }
41 }
42
43 return $parameters;
44 }
45
46 /**
47 * {@inheritdoc}
48 */
49 protected function handleRouteRequirements($pathinfo, $name, Route $route)
50 {
51 // expression condition
52 if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), ['context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)])) {
53 return [self::REQUIREMENT_MISMATCH, null];
54 }
55
56 // check HTTP scheme requirement
57 $scheme = $this->context->getScheme();
58 $schemes = $route->getSchemes();
59 if ($schemes && !$route->hasScheme($scheme)) {
60 return [self::ROUTE_MATCH, $this->redirect($pathinfo, $name, current($schemes))];
61 }
62
63 return [self::REQUIREMENT_MATCH, null];
64 }
65 }
66