[ROUTES] Allow accept-header specification during router creation

Router:
- Fix calls to connect, most of them were misusing the function's params

URLMapper:
- Minor fixes
- Documentation
- Add support for accept-header specification

Plugins/*:
- Fix calls to connect
This commit is contained in:
brunoccast
2019-07-11 19:14:03 +01:00
committed by Diogo Cordeiro
parent 2032c7c1f7
commit 5c0a3102ff
48 changed files with 1023 additions and 871 deletions

View File

@@ -39,16 +39,16 @@ class WebFingerPlugin extends Plugin
public function onRouterInitialized(URLMapper $m)
{
$m->connect('.well-known/host-meta', array('action' => 'hostmeta'));
$m->connect('.well-known/host-meta', ['action' => 'hostmeta']);
$m->connect('.well-known/host-meta.:format',
array('action' => 'hostmeta',
'format' => '(xml|json)'));
['action' => 'hostmeta'],
['format' => '(xml|json)']);
// the resource GET parameter can be anywhere, so don't mention it here
$m->connect('.well-known/webfinger', array('action' => 'webfinger'));
$m->connect('.well-known/webfinger', ['action' => 'webfinger']);
$m->connect('.well-known/webfinger.:format',
array('action' => 'webfinger',
'format' => '(xml|json)'));
$m->connect('main/ownerxrd', array('action' => 'ownerxrd'));
['action' => 'webfinger'],
['format' => '(xml|json)']);
$m->connect('main/ownerxrd', ['action' => 'ownerxrd']);
return true;
}