, :
- - ( URL-
), (, XML);
- ,
(, );
- , : ,
XML , .
- ,
.
, :
- ( , XML),
- ,
".
- :
PHP- .
- php . APC
php-,
.
:
Router:: addRoute (, ) -
Router:: match (uri) -
You can store routes in any format you like (XML, Json, in the database), and generate a simple PHP file to quickly load routes at runtime:
<?php
$router = new Router();
$router->addRoute('/', 'HomeController');
$router->addRoute('/widgets', 'WidgetsController');
tl; dr: separate route parsing from route matching. Only parse the rules once and compile the result into PHP code that APC can cache.
Hope this helps.
source
share