TomFrost / Hydrogen

Hydrogen is a PHP 5.3+ performance and portability library
http://www.hydrogenphp.com
Other
40 stars 11 forks source link

Route Caching #13

Open bcentinaro opened 12 years ago

bcentinaro commented 12 years ago

route caching currently doesn't seem to take HTTP Verb into account

For example

$router->post('/(:controller(/:function(/:*args)))',
    array('controller' => 'home','function' => 'index'),
    array('controller' => '\vespora\controllers\main\%{controller|capfirst}Controller',
        'function' => '%{function|lower}_post'));

$router->request('/(:controller(/:function(/:*args)))',
    array('controller' => 'home','function' => 'index' ),
    array('controller' => '\vespora\controllers\main\%{controller|capfirst}Controller'));

when the following routes are added to the route, the first request GET: /user/login, maps properly as expected, to \vespora\controllers\main\UserController->login()

However, when the login page posts back to itself, it calls \vespora\controllers\main\UserController->login() rather then \vespora\controllers\main\UserController->login_post()

bcentinaro commented 12 years ago

Since my hydrogen repo's got some application specific modifications, it's broked my ability to add change requests...

https://github.com/TNBBill/Hydrogen/commit/3e31395c391950661dd2f7666adf18aa4bda5180

There's the change the fixed the issue.