Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Phil Sturgeon | 07c1ac8 | 2012-03-09 17:03:37 +0000 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.2.4 or newer |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 6 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 7 | * NOTICE OF LICENSE |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 8 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 9 | * Licensed under the Open Software License version 3.0 |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 10 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 19 | * @package CodeIgniter |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 20 | * @author EllisLab Dev Team |
Greg Aker | 0defe5d | 2012-01-01 18:46:41 -0600 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 23 | * @link http://codeigniter.com |
| 24 | * @since Version 1.0 |
| 25 | * @filesource |
| 26 | */ |
| 27 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 28 | /** |
| 29 | * Router Class |
| 30 | * |
| 31 | * Parses URIs and determines routing |
| 32 | * |
| 33 | * @package CodeIgniter |
| 34 | * @subpackage Libraries |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 35 | * @category Libraries |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 36 | * @author EllisLab Dev Team |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 37 | * @link http://codeigniter.com/user_guide/general/routing.html |
| 38 | */ |
| 39 | class CI_Router { |
| 40 | |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 41 | /** |
| 42 | * Config class |
| 43 | * |
| 44 | * @var object |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 45 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 46 | public $config; |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 47 | |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 48 | /** |
| 49 | * List of routes |
| 50 | * |
| 51 | * @var array |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 52 | */ |
Timothy Warren | 48a7fbb | 2012-04-23 11:58:16 -0400 | [diff] [blame] | 53 | public $routes = array(); |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 54 | |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 55 | /** |
| 56 | * List of error routes |
| 57 | * |
| 58 | * @var array |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 59 | */ |
Timothy Warren | 48a7fbb | 2012-04-23 11:58:16 -0400 | [diff] [blame] | 60 | public $error_routes = array(); |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 61 | |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 62 | /** |
| 63 | * Current class name |
| 64 | * |
| 65 | * @var string |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 66 | */ |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 67 | public $class = ''; |
| 68 | |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 69 | /** |
| 70 | * Current method name |
| 71 | * |
| 72 | * @var string |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 73 | */ |
Timothy Warren | 48a7fbb | 2012-04-23 11:58:16 -0400 | [diff] [blame] | 74 | public $method = 'index'; |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 75 | |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 76 | /** |
| 77 | * Sub-directory that contains the requested controller class |
| 78 | * |
| 79 | * @var string |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 80 | */ |
Timothy Warren | 48a7fbb | 2012-04-23 11:58:16 -0400 | [diff] [blame] | 81 | public $directory = ''; |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 82 | |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 83 | /** |
| 84 | * Default controller (and method if specific) |
| 85 | * |
| 86 | * @var string |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 87 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 88 | public $default_controller; |
Jonatas Miguel | a101c93 | 2012-07-20 12:23:43 +0200 | [diff] [blame] | 89 | |
| 90 | /** |
| 91 | * Prepend used in php processed routes |
| 92 | * |
| 93 | * @var string |
| 94 | */ |
| 95 | public $route_prepend = 'php:'; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 96 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 97 | /** |
| 98 | * Constructor |
| 99 | * |
| 100 | * Runs the route mapping function. |
Andrey Andreev | 92ebfb6 | 2012-05-17 12:49:24 +0300 | [diff] [blame] | 101 | * |
| 102 | * @return void |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 103 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 104 | public function __construct() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 105 | { |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 106 | $this->config =& load_class('Config', 'core'); |
| 107 | $this->uri =& load_class('URI', 'core'); |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 108 | log_message('debug', 'Router Class Initialized'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 109 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 110 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 111 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 112 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 113 | /** |
| 114 | * Set the route mapping |
| 115 | * |
| 116 | * This function determines what should be served based on the URI request, |
| 117 | * as well as any "routes" that have been set in the routing config file. |
| 118 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 119 | * @return void |
| 120 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 121 | public function _set_routing() |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 122 | { |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 123 | // Are query strings enabled in the config file? Normally CI doesn't utilize query strings |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 124 | // since URI segments are more search-engine friendly, but they can optionally be used. |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 125 | // If this feature is enabled, we will gather the directory/class/method a little differently |
| 126 | $segments = array(); |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 127 | if ($this->config->item('enable_query_strings') === TRUE && isset($_GET[$this->config->item('controller_trigger')])) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 128 | { |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 129 | if (isset($_GET[$this->config->item('directory_trigger')])) |
| 130 | { |
| 131 | $this->set_directory(trim($this->uri->_filter_uri($_GET[$this->config->item('directory_trigger')]))); |
| 132 | $segments[] = $this->fetch_directory(); |
| 133 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 134 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 135 | if (isset($_GET[$this->config->item('controller_trigger')])) |
| 136 | { |
| 137 | $this->set_class(trim($this->uri->_filter_uri($_GET[$this->config->item('controller_trigger')]))); |
| 138 | $segments[] = $this->fetch_class(); |
| 139 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 140 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 141 | if (isset($_GET[$this->config->item('function_trigger')])) |
| 142 | { |
| 143 | $this->set_method(trim($this->uri->_filter_uri($_GET[$this->config->item('function_trigger')]))); |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 144 | $segments[] = $this->fetch_method(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 145 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 146 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 147 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 148 | // Load the routes.php file. |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 149 | if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/routes.php')) |
Greg Aker | d96f882 | 2011-12-27 16:23:47 -0600 | [diff] [blame] | 150 | { |
| 151 | include(APPPATH.'config/'.ENVIRONMENT.'/routes.php'); |
| 152 | } |
| 153 | elseif (is_file(APPPATH.'config/routes.php')) |
| 154 | { |
| 155 | include(APPPATH.'config/routes.php'); |
| 156 | } |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 157 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 158 | $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; |
| 159 | unset($route); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 160 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 161 | // Set the default controller so we can display it in the event |
| 162 | // the URI doesn't correlated to a valid controller. |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 163 | $this->default_controller = empty($this->routes['default_controller']) ? FALSE : strtolower($this->routes['default_controller']); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 164 | |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 165 | // Were there any query string segments? If so, we'll validate them and bail out since we're done. |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 166 | if (count($segments) > 0) |
| 167 | { |
| 168 | return $this->_validate_request($segments); |
| 169 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 170 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 171 | // Fetch the complete URI string |
| 172 | $this->uri->_fetch_uri_string(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 173 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 174 | // Is there a URI string? If not, the default controller specified in the "routes" file will be shown. |
Andrey Andreev | 9ba661b | 2012-06-04 14:44:34 +0300 | [diff] [blame] | 175 | if ($this->uri->uri_string == '') |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 176 | { |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 177 | return $this->_set_default_controller(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 178 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 179 | |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 180 | $this->uri->_remove_url_suffix(); // Remove the URL suffix |
| 181 | $this->uri->_explode_segments(); // Compile the segments into an array |
| 182 | $this->_parse_routes(); // Parse any custom routing that may exist |
| 183 | $this->uri->_reindex_segments(); // Re-index the segment array so that it starts with 1 rather than 0 |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 184 | } |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 185 | |
| 186 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 187 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 188 | /** |
| 189 | * Set the default controller |
| 190 | * |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 191 | * @return void |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 192 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 193 | protected function _set_default_controller() |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 194 | { |
| 195 | if ($this->default_controller === FALSE) |
| 196 | { |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 197 | show_error('Unable to determine what should be displayed. A default route has not been specified in the routing file.'); |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 198 | } |
| 199 | // Is the method being specified? |
| 200 | if (strpos($this->default_controller, '/') !== FALSE) |
| 201 | { |
| 202 | $x = explode('/', $this->default_controller); |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 203 | $this->set_class($x[0]); |
| 204 | $this->set_method($x[1]); |
Pascal Kriete | 790ebf3 | 2010-12-15 10:53:35 -0500 | [diff] [blame] | 205 | $this->_set_request($x); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 206 | } |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 207 | else |
| 208 | { |
| 209 | $this->set_class($this->default_controller); |
| 210 | $this->set_method('index'); |
| 211 | $this->_set_request(array($this->default_controller, 'index')); |
| 212 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 213 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 214 | // re-index the routed segments array so it starts with 1 rather than 0 |
| 215 | $this->uri->_reindex_segments(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 216 | |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 217 | log_message('debug', 'No URI present. Default controller set.'); |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 218 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 219 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 220 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 221 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 222 | /** |
| 223 | * Set the Route |
| 224 | * |
| 225 | * This function takes an array of URI segments as |
| 226 | * input, and sets the current class/method |
| 227 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 228 | * @param array |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 229 | * @return void |
| 230 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 231 | protected function _set_request($segments = array()) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 232 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 233 | $segments = $this->_validate_request($segments); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 234 | |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 235 | if (count($segments) === 0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 236 | { |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 237 | return $this->_set_default_controller(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 238 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 239 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 240 | $this->set_class($segments[0]); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 241 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 242 | if (isset($segments[1])) |
| 243 | { |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 244 | // A standard method request |
| 245 | $this->set_method($segments[1]); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 246 | } |
| 247 | else |
| 248 | { |
| 249 | // This lets the "routed" segment array identify that the default |
| 250 | // index method is being used. |
| 251 | $segments[1] = 'index'; |
| 252 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 253 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 254 | // Update our "routed" segment array to contain the segments. |
| 255 | // Note: If there is no custom routing, this array will be |
Phil Sturgeon | 81aa94b | 2012-05-02 11:40:46 +0100 | [diff] [blame] | 256 | // identical to $this->uri->segments |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 257 | $this->uri->rsegments = $segments; |
| 258 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 259 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 260 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 261 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 262 | /** |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 263 | * Validates the supplied segments. |
| 264 | * Attempts to determine the path to the controller. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 265 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 266 | * @param array |
| 267 | * @return array |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 268 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 269 | protected function _validate_request($segments) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 270 | { |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 271 | if (count($segments) === 0) |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 272 | { |
| 273 | return $segments; |
| 274 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 275 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 276 | // Does the requested controller exist in the root folder? |
Greg Aker | 3a74665 | 2011-04-19 10:59:47 -0500 | [diff] [blame] | 277 | if (file_exists(APPPATH.'controllers/'.$segments[0].'.php')) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 278 | { |
| 279 | return $segments; |
| 280 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 281 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 282 | // Is the controller in a sub-folder? |
| 283 | if (is_dir(APPPATH.'controllers/'.$segments[0])) |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 284 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 285 | // Set the directory and remove it from the segment array |
| 286 | $this->set_directory($segments[0]); |
| 287 | $segments = array_slice($segments, 1); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 288 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 289 | if (count($segments) > 0) |
| 290 | { |
| 291 | // Does the requested controller exist in the sub-folder? |
Greg Aker | 3a74665 | 2011-04-19 10:59:47 -0500 | [diff] [blame] | 292 | if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php')) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 293 | { |
Shane Pearson | 664a935 | 2011-08-10 16:02:32 -0500 | [diff] [blame] | 294 | if ( ! empty($this->routes['404_override'])) |
| 295 | { |
| 296 | $x = explode('/', $this->routes['404_override']); |
Shane Pearson | 664a935 | 2011-08-10 16:02:32 -0500 | [diff] [blame] | 297 | $this->set_directory(''); |
| 298 | $this->set_class($x[0]); |
| 299 | $this->set_method(isset($x[1]) ? $x[1] : 'index'); |
David Behler | 07b5342 | 2011-08-15 00:25:06 +0200 | [diff] [blame] | 300 | |
Shane Pearson | 664a935 | 2011-08-10 16:02:32 -0500 | [diff] [blame] | 301 | return $x; |
| 302 | } |
| 303 | else |
| 304 | { |
| 305 | show_404($this->fetch_directory().$segments[0]); |
| 306 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 307 | } |
| 308 | } |
| 309 | else |
| 310 | { |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 311 | // Is the method being specified in the route? |
| 312 | if (strpos($this->default_controller, '/') !== FALSE) |
| 313 | { |
| 314 | $x = explode('/', $this->default_controller); |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 315 | $this->set_class($x[0]); |
| 316 | $this->set_method($x[1]); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 317 | } |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 318 | else |
| 319 | { |
| 320 | $this->set_class($this->default_controller); |
| 321 | $this->set_method('index'); |
| 322 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 323 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 324 | // Does the default controller exist in the sub-folder? |
Greg Aker | 3a74665 | 2011-04-19 10:59:47 -0500 | [diff] [blame] | 325 | if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.'.php')) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 326 | { |
| 327 | $this->directory = ''; |
| 328 | return array(); |
| 329 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 330 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 331 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 332 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 333 | return $segments; |
| 334 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 335 | |
| 336 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 337 | // If we've gotten this far it means that the URI does not correlate to a valid |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 338 | // controller class. We will now see if there is an override |
Eric Barnes | c5bf616 | 2011-01-30 21:17:11 -0500 | [diff] [blame] | 339 | if ( ! empty($this->routes['404_override'])) |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 340 | { |
Phil Sturgeon | 23174a6 | 2010-12-15 15:18:16 +0000 | [diff] [blame] | 341 | $x = explode('/', $this->routes['404_override']); |
Phil Sturgeon | 23174a6 | 2010-12-15 15:18:16 +0000 | [diff] [blame] | 342 | $this->set_class($x[0]); |
| 343 | $this->set_method(isset($x[1]) ? $x[1] : 'index'); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 344 | |
Phil Sturgeon | 23174a6 | 2010-12-15 15:18:16 +0000 | [diff] [blame] | 345 | return $x; |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 346 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 347 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 348 | // Nothing else to do at this point but show a 404 |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 349 | show_404($segments[0]); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 350 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 351 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 352 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 353 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 354 | /** |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 355 | * Parse Routes |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 356 | * |
| 357 | * This function matches any routes that may exist in |
| 358 | * the config/routes.php file against the URI to |
| 359 | * determine if the class/method need to be remapped. |
| 360 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 361 | * @return void |
| 362 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 363 | protected function _parse_routes() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 364 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 365 | // Turn the segment array into a URI string |
| 366 | $uri = implode('/', $this->uri->segments); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 367 | |
Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 368 | // Is there a literal match? If so we're done |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 369 | if (isset($this->routes[$uri])) |
| 370 | { |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 371 | return $this->_set_request(explode('/', $this->routes[$uri])); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 372 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 373 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 374 | // Loop through the route array looking for wild-cards |
| 375 | foreach ($this->routes as $key => $val) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 376 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 377 | // Convert wild-cards to RegEx |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 378 | $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key); |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 379 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 380 | // Does the RegEx match? |
| 381 | if (preg_match('#^'.$key.'$#', $uri)) |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 382 | { |
Jonatas Miguel | 80275c7 | 2012-08-01 19:15:48 +0200 | [diff] [blame^] | 383 | // Are we using a callback? |
| 384 | $callable = is_callable($val); |
| 385 | |
| 386 | // Determine the appropriate preg_replace to use. |
| 387 | $preg_replace_type = $callable? 'preg_replace_callback': 'preg_replace'; |
| 388 | |
| 389 | // Are we using the route_prepend to change how we process the matches? |
| 390 | $modifier = (is_string($val) AND strpos($val, $this->route_prepend) === 0)? 'e': ''; |
Jonatas Miguel | a101c93 | 2012-07-20 12:23:43 +0200 | [diff] [blame] | 391 | |
Jonatas Miguel | 80275c7 | 2012-08-01 19:15:48 +0200 | [diff] [blame^] | 392 | // Are we using callbacks to process the matches? |
| 393 | if($callable){ |
| 394 | $val = function($matches)use($val){ |
| 395 | // Remove the string we are matching against from the matches array. |
| 396 | array_shift($matches); |
| 397 | |
| 398 | // Distribute the matches to the arguments of the user's callback. |
| 399 | return call_user_func_array($val, $matches); |
| 400 | }; |
| 401 | } |
| 402 | else |
| 403 | { |
| 404 | // Remove the "php:" portion of the string if it exists. |
| 405 | $val = $modifier === 'e'? substr($val, strlen($this->route_prepend)): $val; |
| 406 | } |
Jonatas Miguel | a101c93 | 2012-07-20 12:23:43 +0200 | [diff] [blame] | 407 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 408 | // Do we have a back-reference? |
Jonatas Miguel | 80275c7 | 2012-08-01 19:15:48 +0200 | [diff] [blame^] | 409 | if ($callable OR (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 410 | { |
Jonatas Miguel | 80275c7 | 2012-08-01 19:15:48 +0200 | [diff] [blame^] | 411 | $val = call_user_func($preg_replace_type, '#^'.$key.'$#'.$modifier, $val, $uri); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 412 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 413 | |
| 414 | return $this->_set_request(explode('/', $val)); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 415 | } |
| 416 | } |
| 417 | |
| 418 | // If we got this far it means we didn't encounter a |
| 419 | // matching route so we'll set the site default route |
| 420 | $this->_set_request($this->uri->segments); |
| 421 | } |
| 422 | |
| 423 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 424 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 425 | /** |
| 426 | * Set the class name |
| 427 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 428 | * @param string |
| 429 | * @return void |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 430 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 431 | public function set_class($class) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 432 | { |
Derek Jones | 2615e41 | 2010-10-06 17:51:16 -0500 | [diff] [blame] | 433 | $this->class = str_replace(array('/', '.'), '', $class); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 434 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 435 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 436 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 437 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 438 | /** |
| 439 | * Fetch the current class |
| 440 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 441 | * @return string |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 442 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 443 | public function fetch_class() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 444 | { |
| 445 | return $this->class; |
| 446 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 447 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 448 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 449 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 450 | /** |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 451 | * Set the method name |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 452 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 453 | * @param string |
| 454 | * @return void |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 455 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 456 | public function set_method($method) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 457 | { |
| 458 | $this->method = $method; |
| 459 | } |
| 460 | |
| 461 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 462 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 463 | /** |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 464 | * Fetch the current method |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 465 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 466 | * @return string |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 467 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 468 | public function fetch_method() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 469 | { |
Alex Bilbie | ed944a3 | 2012-06-02 11:07:47 +0100 | [diff] [blame] | 470 | return ($this->method === $this->fetch_class()) ? 'index' : $this->method; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 471 | } |
| 472 | |
| 473 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 474 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 475 | /** |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 476 | * Set the directory name |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 477 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 478 | * @param string |
| 479 | * @return void |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 480 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 481 | public function set_directory($dir) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 482 | { |
Derek Jones | 2615e41 | 2010-10-06 17:51:16 -0500 | [diff] [blame] | 483 | $this->directory = str_replace(array('/', '.'), '', $dir).'/'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 484 | } |
| 485 | |
| 486 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 487 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 488 | /** |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 489 | * Fetch the sub-directory (if any) that contains the requested controller class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 490 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 491 | * @return string |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 492 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 493 | public function fetch_directory() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 494 | { |
| 495 | return $this->directory; |
| 496 | } |
| 497 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 498 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 499 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 500 | /** |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 501 | * Set the controller overrides |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 502 | * |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 503 | * @param array |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 504 | * @return void |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 505 | */ |
Andrey Andreev | ba6c041 | 2012-01-07 21:10:09 +0200 | [diff] [blame] | 506 | public function _set_overrides($routing) |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 507 | { |
| 508 | if ( ! is_array($routing)) |
| 509 | { |
| 510 | return; |
| 511 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 512 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 513 | if (isset($routing['directory'])) |
| 514 | { |
| 515 | $this->set_directory($routing['directory']); |
| 516 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 517 | |
Andrey Andreev | 9ba661b | 2012-06-04 14:44:34 +0300 | [diff] [blame] | 518 | if ( ! empty($routing['controller'])) |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 519 | { |
| 520 | $this->set_class($routing['controller']); |
| 521 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 522 | |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 523 | if (isset($routing['function'])) |
| 524 | { |
Andrey Andreev | 9ba661b | 2012-06-04 14:44:34 +0300 | [diff] [blame] | 525 | $routing['function'] = ($routing['function'] == '') ? 'index' : $routing['function']; |
Derek Jones | c773840 | 2010-03-02 13:55:13 -0600 | [diff] [blame] | 526 | $this->set_method($routing['function']); |
| 527 | } |
| 528 | } |
| 529 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 530 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 531 | |
| 532 | /* End of file Router.php */ |
Andrey Andreev | 7b53d04 | 2012-03-26 23:02:32 +0300 | [diff] [blame] | 533 | /* Location: ./system/core/Router.php */ |