c9s/Pux — pull request #69 by rubensayshi (2014-11-10 10:02:59+00:00)
Title: Merging options nicely

As you can see in the test I've added the old code wouldn't merge recursively, as a result you couldn't set 'default' or 'require' options on a mount.

with these changes and the (already merged) change of being able to mount a lambda you can do stuff like the example below with overwriting options etc.

```php
// mount API
$mux->mount('', function(Mux $mux) {
// mount v1 API
$mux->mount('/v1/:network', function(Mux $mux) {
// mount endpoints ...
$mux->get('/block/:blockhash(.:format)', "BlockController:getBlock");
}, [
'default' => [
'format' => 'xml'
],
'require' => [ 'network' => '[a-zA-Z]{3,4}' ],
]);
}, [
'domain' => 'api.blocktrail.com',
'default' => [
'network' => 'BTC',
'format' => 'json'
],
'require' => [
'format' => 'json|csv|xml'
],
]);
```