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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

CompiledRoute.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 4.26 KiB


001  <?php
002   
003  /*
004   * This file is part of the Symfony package.
005   *
006   * (c) Fabien Potencier <fabien@symfony.com>
007   *
008   * For the full copyright and license information, please view the LICENSE
009   * file that was distributed with this source code.
010   */
011   
012  namespace Symfony\Component\Routing;
013   
014  /**
015   * CompiledRoutes are returned by the RouteCompiler class.
016   *
017   * @author Fabien Potencier <fabien@symfony.com>
018   */
019  class CompiledRoute implements \Serializable
020  {
021      private $variables;
022      private $tokens;
023      private $staticPrefix;
024      private $regex;
025      private $pathVariables;
026      private $hostVariables;
027      private $hostRegex;
028      private $hostTokens;
029   
030      /**
031       * @param string      $staticPrefix  The static prefix of the compiled route
032       * @param string      $regex         The regular expression to use to match this route
033       * @param array       $tokens        An array of tokens to use to generate URL for this route
034       * @param array       $pathVariables An array of path variables
035       * @param string|null $hostRegex     Host regex
036       * @param array       $hostTokens    Host tokens
037       * @param array       $hostVariables An array of host variables
038       * @param array       $variables     An array of variables (variables defined in the path and in the host patterns)
039       */
040      public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = [], array $hostVariables = [], array $variables = [])
041      {
042          $this->staticPrefix = (string) $staticPrefix;
043          $this->regex = $regex;
044          $this->tokens = $tokens;
045          $this->pathVariables = $pathVariables;
046          $this->hostRegex = $hostRegex;
047          $this->hostTokens = $hostTokens;
048          $this->hostVariables = $hostVariables;
049          $this->variables = $variables;
050      }
051   
052      /**
053       * {@inheritdoc}
054       */
055      public function serialize()
056      {
057          return serialize([
058              'vars' => $this->variables,
059              'path_prefix' => $this->staticPrefix,
060              'path_regex' => $this->regex,
061              'path_tokens' => $this->tokens,
062              'path_vars' => $this->pathVariables,
063              'host_regex' => $this->hostRegex,
064              'host_tokens' => $this->hostTokens,
065              'host_vars' => $this->hostVariables,
066          ]);
067      }
068   
069      /**
070       * {@inheritdoc}
071       */
072      public function unserialize($serialized)
073      {
074          if (\PHP_VERSION_ID >= 70000) {
075              $data = unserialize($serialized, ['allowed_classes' => false]);
076          } else {
077              $data = unserialize($serialized);
078          }
079   
080          $this->variables = $data['vars'];
081          $this->staticPrefix = $data['path_prefix'];
082          $this->regex = $data['path_regex'];
083          $this->tokens = $data['path_tokens'];
084          $this->pathVariables = $data['path_vars'];
085          $this->hostRegex = $data['host_regex'];
086          $this->hostTokens = $data['host_tokens'];
087          $this->hostVariables = $data['host_vars'];
088      }
089   
090      /**
091       * Returns the static prefix.
092       *
093       * @return string The static prefix
094       */
095      public function getStaticPrefix()
096      {
097          return $this->staticPrefix;
098      }
099   
100      /**
101       * Returns the regex.
102       *
103       * @return string The regex
104       */
105      public function getRegex()
106      {
107          return $this->regex;
108      }
109   
110      /**
111       * Returns the host regex.
112       *
113       * @return string|null The host regex or null
114       */
115      public function getHostRegex()
116      {
117          return $this->hostRegex;
118      }
119   
120      /**
121       * Returns the tokens.
122       *
123       * @return array The tokens
124       */
125      public function getTokens()
126      {
127          return $this->tokens;
128      }
129   
130      /**
131       * Returns the host tokens.
132       *
133       * @return array The tokens
134       */
135      public function getHostTokens()
136      {
137          return $this->hostTokens;
138      }
139   
140      /**
141       * Returns the variables.
142       *
143       * @return array The variables
144       */
145      public function getVariables()
146      {
147          return $this->variables;
148      }
149   
150      /**
151       * Returns the path variables.
152       *
153       * @return array The variables
154       */
155      public function getPathVariables()
156      {
157          return $this->pathVariables;
158      }
159   
160      /**
161       * Returns the host variables.
162       *
163       * @return array The variables
164       */
165      public function getHostVariables()
166      {
167          return $this->hostVariables;
168      }
169  }
170