Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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

Route.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 4.41 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\Annotation;
013   
014  /**
015   * Annotation class for @Route().
016   *
017   * @Annotation
018   * @Target({"CLASS", "METHOD"})
019   *
020   * @author Fabien Potencier <fabien@symfony.com>
021   */
022  class Route
023  {
024      private $path;
025      private $name;
026      private $requirements = array();
027      private $options = array();
028      private $defaults = array();
029      private $host;
030      private $methods = array();
031      private $schemes = array();
032      private $condition;
033   
034      /**
035       * Constructor.
036       *
037       * @param array $data An array of key/value parameters
038       *
039       * @throws \BadMethodCallException
040       */
041      public function __construct(array $data)
042      {
043          if (isset($data['value'])) {
044              $data['path'] = $data['value'];
045              unset($data['value']);
046          }
047   
048          foreach ($data as $key => $value) {
049              $method = 'set'.str_replace('_', '', $key);
050              if (!method_exists($this, $method)) {
051                  throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, get_class($this)));
052              }
053              $this->$method($value);
054          }
055      }
056   
057      /**
058       * @deprecated since version 2.2, to be removed in 3.0. Use setPath instead.
059       */
060      public function setPattern($pattern)
061      {
062          @trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the setPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED);
063   
064          $this->path = $pattern;
065      }
066   
067      /**
068       * @deprecated since version 2.2, to be removed in 3.0. Use getPath instead.
069       */
070      public function getPattern()
071      {
072          @trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the getPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED);
073   
074          return $this->path;
075      }
076   
077      public function setPath($path)
078      {
079          $this->path = $path;
080      }
081   
082      public function getPath()
083      {
084          return $this->path;
085      }
086   
087      public function setHost($pattern)
088      {
089          $this->host = $pattern;
090      }
091   
092      public function getHost()
093      {
094          return $this->host;
095      }
096   
097      public function setName($name)
098      {
099          $this->name = $name;
100      }
101   
102      public function getName()
103      {
104          return $this->name;
105      }
106   
107      public function setRequirements($requirements)
108      {
109          if (isset($requirements['_method'])) {
110              if (0 === count($this->methods)) {
111                  $this->methods = explode('|', $requirements['_method']);
112              }
113   
114              @trigger_error('The "_method" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" option instead.', E_USER_DEPRECATED);
115          }
116   
117          if (isset($requirements['_scheme'])) {
118              if (0 === count($this->schemes)) {
119                  $this->schemes = explode('|', $requirements['_scheme']);
120              }
121   
122              @trigger_error('The "_scheme" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" option instead.', E_USER_DEPRECATED);
123          }
124   
125          $this->requirements = $requirements;
126      }
127   
128      public function getRequirements()
129      {
130          return $this->requirements;
131      }
132   
133      public function setOptions($options)
134      {
135          $this->options = $options;
136      }
137   
138      public function getOptions()
139      {
140          return $this->options;
141      }
142   
143      public function setDefaults($defaults)
144      {
145          $this->defaults = $defaults;
146      }
147   
148      public function getDefaults()
149      {
150          return $this->defaults;
151      }
152   
153      public function setSchemes($schemes)
154      {
155          $this->schemes = is_array($schemes) ? $schemes : array($schemes);
156      }
157   
158      public function getSchemes()
159      {
160          return $this->schemes;
161      }
162   
163      public function setMethods($methods)
164      {
165          $this->methods = is_array($methods) ? $methods : array($methods);
166      }
167   
168      public function getMethods()
169      {
170          return $this->methods;
171      }
172   
173      public function setCondition($condition)
174      {
175          $this->condition = $condition;
176      }
177   
178      public function getCondition()
179      {
180          return $this->condition;
181      }
182  }
183