PageRenderTime 61ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/phalcon/devtools/ide/2.0.4/Phalcon/mvc/Router.php

https://gitlab.com/habracoder/advertising
PHP | 494 lines | 114 code | 89 blank | 291 comment | 0 complexity | d969ee1672b405e6407e975bc88cc2cd MD5 | raw file
  1. <?php
  2. namespace Phalcon\Mvc;
  3. /**
  4. * Phalcon\Mvc\Router
  5. <<<<<<< HEAD
  6. * Phalcon\Mvc\Router is the standard framework router. Routing is the
  7. * process of taking a URI endpoint (that part of the URI which comes after the base URL) and
  8. * decomposing it into parameters to determine which module, controller, and
  9. * action of that controller should receive the request
  10. * <code>
  11. * $router = new Router();
  12. * $router->add(
  13. * "/documentation/{chapter}/{name}\.{type:[a-z]+}",
  14. =======
  15. * <p>Phalcon\Mvc\Router is the standard framework router. Routing is the
  16. * process of taking a URI endpoint (that part of the URI which comes after the base URL) and
  17. * decomposing it into parameters to determine which module, controller, and
  18. * action of that controller should receive the request</p>
  19. * <code>
  20. * $router = new Router();
  21. * $router->add(
  22. * "/documentation/{chapter}/{name}.{type:[a-z]+}",
  23. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  24. * array(
  25. * "controller" => "documentation",
  26. * "action" => "show"
  27. * )
  28. * );
  29. * $router->handle();
  30. * echo $router->getControllerName();
  31. * </code>
  32. */
  33. <<<<<<< HEAD
  34. class Router implements \Phalcon\Di\InjectionAwareInterface, \Phalcon\Mvc\RouterInterface, \Phalcon\Events\EventsAwareInterface
  35. =======
  36. class Router implements \Phalcon\Di\InjectionAwareInterface, \Phalcon\Mvc\RouterInterface
  37. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  38. {
  39. const URI_SOURCE_GET_URL = 0;
  40. const URI_SOURCE_SERVER_REQUEST_URI = 1;
  41. <<<<<<< HEAD
  42. const POSITION_FIRST = 0;
  43. const POSITION_LAST = 1;
  44. protected $_dependencyInjector;
  45. protected $_eventsManager;
  46. =======
  47. protected $_dependencyInjector;
  48. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  49. protected $_uriSource;
  50. protected $_namespace = null;
  51. protected $_module = null;
  52. protected $_controller = null;
  53. protected $_action = null;
  54. protected $_params;
  55. protected $_routes;
  56. protected $_matchedRoute;
  57. protected $_matches;
  58. protected $_wasMatched = false;
  59. protected $_defaultNamespace;
  60. protected $_defaultModule;
  61. protected $_defaultController;
  62. protected $_defaultAction;
  63. protected $_defaultParams;
  64. protected $_removeExtraSlashes;
  65. protected $_notFoundPaths;
  66. /**
  67. * Phalcon\Mvc\Router constructor
  68. *
  69. * @param bool $defaultRoutes
  70. */
  71. public function __construct($defaultRoutes = true) {}
  72. /**
  73. * Sets the dependency injector
  74. *
  75. * @param mixed $dependencyInjector
  76. */
  77. public function setDI(\Phalcon\DiInterface $dependencyInjector) {}
  78. /**
  79. * Returns the internal dependency injector
  80. *
  81. * @return \Phalcon\DiInterface
  82. */
  83. public function getDI() {}
  84. /**
  85. <<<<<<< HEAD
  86. * Sets the events manager
  87. *
  88. * @param mixed $eventsManager
  89. */
  90. public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) {}
  91. /**
  92. * Returns the internal event manager
  93. *
  94. * @return \Phalcon\Events\ManagerInterface
  95. */
  96. public function getEventsManager() {}
  97. /**
  98. =======
  99. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  100. * Get rewrite info. This info is read from $_GET['_url']. This returns '/' if the rewrite information cannot be read
  101. *
  102. * @return string
  103. */
  104. public function getRewriteUri() {}
  105. /**
  106. * Sets the URI source. One of the URI_SOURCE_* constants
  107. * <code>
  108. * $router->setUriSource(Router::URI_SOURCE_SERVER_REQUEST_URI);
  109. * </code>
  110. *
  111. * @param mixed $uriSource
  112. * @return RouterInterface
  113. */
  114. public function setUriSource($uriSource) {}
  115. /**
  116. * Set whether router must remove the extra slashes in the handled routes
  117. *
  118. * @param bool $remove
  119. * @return RouterInterface
  120. */
  121. public function removeExtraSlashes($remove) {}
  122. /**
  123. * Sets the name of the default namespace
  124. *
  125. * @param string $namespaceName
  126. * @return RouterInterface
  127. */
  128. public function setDefaultNamespace($namespaceName) {}
  129. /**
  130. * Sets the name of the default module
  131. *
  132. * @param string $moduleName
  133. * @return RouterInterface
  134. */
  135. public function setDefaultModule($moduleName) {}
  136. /**
  137. * Sets the default controller name
  138. *
  139. * @param string $controllerName
  140. * @return RouterInterface
  141. */
  142. public function setDefaultController($controllerName) {}
  143. /**
  144. * Sets the default action name
  145. *
  146. * @param string $actionName
  147. * @return RouterInterface
  148. */
  149. public function setDefaultAction($actionName) {}
  150. /**
  151. * Sets an array of default paths. If a route is missing a path the router will use the defined here
  152. * This method must not be used to set a 404 route
  153. * <code>
  154. * $router->setDefaults(array(
  155. * 'module' => 'common',
  156. * 'action' => 'index'
  157. * ));
  158. * </code>
  159. *
  160. * @param array $defaults
  161. * @return RouterInterface
  162. */
  163. public function setDefaults($defaults) {}
  164. /**
  165. * Returns an array of default parameters
  166. *
  167. * @return array
  168. */
  169. public function getDefaults() {}
  170. /**
  171. * Handles routing information received from the rewrite engine
  172. * <code>
  173. * //Read the info from the rewrite engine
  174. * $router->handle();
  175. * //Manually passing an URL
  176. * $router->handle('/posts/edit/1');
  177. * </code>
  178. *
  179. * @param string $uri
  180. */
  181. public function handle($uri = null) {}
  182. /**
  183. * Adds a route to the router without any HTTP constraint
  184. * <code>
  185. <<<<<<< HEAD
  186. * use Phalcon\Mvc\Router;
  187. * $router->add('/about', 'About::index');
  188. * $router->add('/about', 'About::index', ['GET', 'POST']);
  189. * $router->add('/about', 'About::index', ['GET', 'POST'], Router::POSITION_FIRST);
  190. =======
  191. * $router->add('/about', 'About::index');
  192. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  193. * </code>
  194. *
  195. * @param string $pattern
  196. * @param mixed $paths
  197. * @param mixed $httpMethods
  198. <<<<<<< HEAD
  199. * @param mixed $position
  200. * @return \Phalcon\Mvc\Router\RouteInterface
  201. */
  202. public function add($pattern, $paths = null, $httpMethods = null, $position = Router::POSITION_LAST) {}
  203. =======
  204. * @return \Phalcon\Mvc\Router\RouteInterface
  205. */
  206. public function add($pattern, $paths = null, $httpMethods = null) {}
  207. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  208. /**
  209. * Adds a route to the router that only match if the HTTP method is GET
  210. *
  211. * @param string $pattern
  212. * @param mixed $paths
  213. <<<<<<< HEAD
  214. * @param mixed $position
  215. * @return \Phalcon\Mvc\Router\RouteInterface
  216. */
  217. public function addGet($pattern, $paths = null, $position = null) {}
  218. =======
  219. * @return \Phalcon\Mvc\Router\RouteInterface
  220. */
  221. public function addGet($pattern, $paths = null) {}
  222. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  223. /**
  224. * Adds a route to the router that only match if the HTTP method is POST
  225. *
  226. * @param string $pattern
  227. * @param mixed $paths
  228. <<<<<<< HEAD
  229. * @param mixed $position
  230. * @return \Phalcon\Mvc\Router\RouteInterface
  231. */
  232. public function addPost($pattern, $paths = null, $position = null) {}
  233. =======
  234. * @return \Phalcon\Mvc\Router\RouteInterface
  235. */
  236. public function addPost($pattern, $paths = null) {}
  237. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  238. /**
  239. * Adds a route to the router that only match if the HTTP method is PUT
  240. *
  241. * @param string $pattern
  242. * @param mixed $paths
  243. <<<<<<< HEAD
  244. * @param mixed $position
  245. * @return \Phalcon\Mvc\Router\RouteInterface
  246. */
  247. public function addPut($pattern, $paths = null, $position = null) {}
  248. =======
  249. * @return \Phalcon\Mvc\Router\RouteInterface
  250. */
  251. public function addPut($pattern, $paths = null) {}
  252. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  253. /**
  254. * Adds a route to the router that only match if the HTTP method is PATCH
  255. *
  256. * @param string $pattern
  257. * @param mixed $paths
  258. <<<<<<< HEAD
  259. * @param mixed $position
  260. * @return \Phalcon\Mvc\Router\RouteInterface
  261. */
  262. public function addPatch($pattern, $paths = null, $position = null) {}
  263. =======
  264. * @return \Phalcon\Mvc\Router\RouteInterface
  265. */
  266. public function addPatch($pattern, $paths = null) {}
  267. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  268. /**
  269. * Adds a route to the router that only match if the HTTP method is DELETE
  270. *
  271. * @param string $pattern
  272. * @param mixed $paths
  273. <<<<<<< HEAD
  274. * @param mixed $position
  275. * @return \Phalcon\Mvc\Router\RouteInterface
  276. */
  277. public function addDelete($pattern, $paths = null, $position = null) {}
  278. =======
  279. * @return \Phalcon\Mvc\Router\RouteInterface
  280. */
  281. public function addDelete($pattern, $paths = null) {}
  282. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  283. /**
  284. * Add a route to the router that only match if the HTTP method is OPTIONS
  285. *
  286. * @param string $pattern
  287. * @param mixed $paths
  288. <<<<<<< HEAD
  289. * @param mixed $position
  290. * @return \Phalcon\Mvc\Router\RouteInterface
  291. */
  292. public function addOptions($pattern, $paths = null, $position = null) {}
  293. =======
  294. * @return \Phalcon\Mvc\Router\RouteInterface
  295. */
  296. public function addOptions($pattern, $paths = null) {}
  297. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  298. /**
  299. * Adds a route to the router that only match if the HTTP method is HEAD
  300. *
  301. * @param string $pattern
  302. * @param mixed $paths
  303. <<<<<<< HEAD
  304. * @param mixed $position
  305. * @return \Phalcon\Mvc\Router\RouteInterface
  306. */
  307. public function addHead($pattern, $paths = null, $position = null) {}
  308. =======
  309. * @return \Phalcon\Mvc\Router\RouteInterface
  310. */
  311. public function addHead($pattern, $paths = null) {}
  312. >>>>>>> 5cd73180ea748c3d5e180a24610161d9730cd146
  313. /**
  314. * Mounts a group of routes in the router
  315. *
  316. * @param mixed $group
  317. * @return RouterInterface
  318. */
  319. public function mount(\Phalcon\Mvc\Router\GroupInterface $group) {}
  320. /**
  321. * Set a group of paths to be returned when none of the defined routes are matched
  322. *
  323. * @param mixed $paths
  324. * @return RouterInterface
  325. */
  326. public function notFound($paths) {}
  327. /**
  328. * Removes all the pre-defined routes
  329. */
  330. public function clear() {}
  331. /**
  332. * Returns the processed namespace name
  333. *
  334. * @return string
  335. */
  336. public function getNamespaceName() {}
  337. /**
  338. * Returns the processed module name
  339. *
  340. * @return string
  341. */
  342. public function getModuleName() {}
  343. /**
  344. * Returns the processed controller name
  345. *
  346. * @return string
  347. */
  348. public function getControllerName() {}
  349. /**
  350. * Returns the processed action name
  351. *
  352. * @return string
  353. */
  354. public function getActionName() {}
  355. /**
  356. * Returns the processed parameters
  357. *
  358. * @return array
  359. */
  360. public function getParams() {}
  361. /**
  362. * Returns the route that matchs the handled URI
  363. *
  364. * @return \Phalcon\Mvc\Router\RouteInterface
  365. */
  366. public function getMatchedRoute() {}
  367. /**
  368. * Returns the sub expressions in the regular expression matched
  369. *
  370. * @return array
  371. */
  372. public function getMatches() {}
  373. /**
  374. * Checks if the router macthes any of the defined routes
  375. *
  376. * @return bool
  377. */
  378. public function wasMatched() {}
  379. /**
  380. * Returns all the routes defined in the router
  381. *
  382. * @return \Phalcon\Mvc\Router\RouteInterface
  383. */
  384. public function getRoutes() {}
  385. /**
  386. * Returns a route object by its id
  387. *
  388. * @param mixed $id
  389. * @return bool|\Phalcon\Mvc\Router\RouteInterface
  390. */
  391. public function getRouteById($id) {}
  392. /**
  393. * Returns a route object by its name
  394. *
  395. * @param string $name
  396. * @return bool|\Phalcon\Mvc\Router\RouteInterface
  397. */
  398. public function getRouteByName($name) {}
  399. /**
  400. * Returns whether controller name should not be mangled
  401. *
  402. * @return bool
  403. */
  404. public function isExactControllerName() {}
  405. }