[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 3 /* 4 * This file is part of the Symfony package. 5 * 6 * (c) Fabien Potencier <fabien@symfony.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12 namespace Symfony\Component\Routing; 13 14 /** 15 * CompiledRoutes are returned by the RouteCompiler class. 16 * 17 * @author Fabien Potencier <fabien@symfony.com> 18 */ 19 class CompiledRoute implements \Serializable 20 { 21 private $variables; 22 private $tokens; 23 private $staticPrefix; 24 private $regex; 25 private $pathVariables; 26 private $hostVariables; 27 private $hostRegex; 28 private $hostTokens; 29 30 /** 31 * @param string $staticPrefix The static prefix of the compiled route 32 * @param string $regex The regular expression to use to match this route 33 * @param array $tokens An array of tokens to use to generate URL for this route 34 * @param array $pathVariables An array of path variables 35 * @param string|null $hostRegex Host regex 36 * @param array $hostTokens Host tokens 37 * @param array $hostVariables An array of host variables 38 * @param array $variables An array of variables (variables defined in the path and in the host patterns) 39 */ 40 public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) 41 { 42 $this->staticPrefix = (string) $staticPrefix; 43 $this->regex = $regex; 44 $this->tokens = $tokens; 45 $this->pathVariables = $pathVariables; 46 $this->hostRegex = $hostRegex; 47 $this->hostTokens = $hostTokens; 48 $this->hostVariables = $hostVariables; 49 $this->variables = $variables; 50 } 51 52 /** 53 * {@inheritdoc} 54 */ 55 public function serialize() 56 { 57 return serialize(array( 58 'vars' => $this->variables, 59 'path_prefix' => $this->staticPrefix, 60 'path_regex' => $this->regex, 61 'path_tokens' => $this->tokens, 62 'path_vars' => $this->pathVariables, 63 'host_regex' => $this->hostRegex, 64 'host_tokens' => $this->hostTokens, 65 'host_vars' => $this->hostVariables, 66 )); 67 } 68 69 /** 70 * {@inheritdoc} 71 */ 72 public function unserialize($serialized) 73 { 74 $data = unserialize($serialized); 75 $this->variables = $data['vars']; 76 $this->staticPrefix = $data['path_prefix']; 77 $this->regex = $data['path_regex']; 78 $this->tokens = $data['path_tokens']; 79 $this->pathVariables = $data['path_vars']; 80 $this->hostRegex = $data['host_regex']; 81 $this->hostTokens = $data['host_tokens']; 82 $this->hostVariables = $data['host_vars']; 83 } 84 85 /** 86 * Returns the static prefix. 87 * 88 * @return string The static prefix 89 */ 90 public function getStaticPrefix() 91 { 92 return $this->staticPrefix; 93 } 94 95 /** 96 * Returns the regex. 97 * 98 * @return string The regex 99 */ 100 public function getRegex() 101 { 102 return $this->regex; 103 } 104 105 /** 106 * Returns the host regex. 107 * 108 * @return string|null The host regex or null 109 */ 110 public function getHostRegex() 111 { 112 return $this->hostRegex; 113 } 114 115 /** 116 * Returns the tokens. 117 * 118 * @return array The tokens 119 */ 120 public function getTokens() 121 { 122 return $this->tokens; 123 } 124 125 /** 126 * Returns the host tokens. 127 * 128 * @return array The tokens 129 */ 130 public function getHostTokens() 131 { 132 return $this->hostTokens; 133 } 134 135 /** 136 * Returns the variables. 137 * 138 * @return array The variables 139 */ 140 public function getVariables() 141 { 142 return $this->variables; 143 } 144 145 /** 146 * Returns the path variables. 147 * 148 * @return array The variables 149 */ 150 public function getPathVariables() 151 { 152 return $this->pathVariables; 153 } 154 155 /** 156 * Returns the host variables. 157 * 158 * @return array The variables 159 */ 160 public function getHostVariables() 161 { 162 return $this->hostVariables; 163 } 164 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |