UnionOfRAD/lithium — pull request #898 by jails (2013-04-19 19:19:32+00:00)
Title: Feature/router scope

### Commit 1 (tests isolation):
- Tests are launched with no routes & no scope defined.
- Tests only need to keep itself isolated.

### Commit 2:
Allow `Request`'s `base` attribute to be overrided by scopes.

### Commit 3:
`Request`'s `base` is now directly extracted from `PHP_SELF`, no other abstraction is assumed here. This mean:
- Urls will be generated with the **full path**, `http://localhost/myframeworkrepo/hello_world` will be `http://localhost/myframeworkrepo/app/webroot/hello_world`

So why ?
- `Request` shouldn't assume there's some `.htaccess` files which will do the proper redirect job.
- A library should be allowed to use a path different from `'app/webroot'`
- And because a BC break has been introduced for "root based" library.

WTF ! How I can get my smart url back ?
- Use a virtual host.
- And if you really feel disapointed to see 'app/webroot' in your localhost url, you can:

a) Override the `Request`'s `base` by defining it in your scope:

```php
Router::scope('scope_name', array(
'base' => 'myframeworkrepo'
));
```
in a boostrap file (if you don't use scope, set `false` instead of the `'scope_name'`).

b) And finally create the correct `.htaccess` to make things work.