@api
Overrides RequestMatcherInterface::matchRequest
public function matchRequest(Request $request) {
if ($router_item = $this
->matchDrupalItem($request->attributes
->get('system_path'))) {
$ret = $this
->convertDrupalItem($router_item);
// Stash the router item in the attributes while we're transitioning.
$ret['drupal_menu_item'] = $router_item;
// Most legacy controllers (aka page callbacks) are in a separate file,
// so we have to include that.
if ($router_item['include_file']) {
require_once DRUPAL_ROOT . '/' . $router_item['include_file'];
}
return $ret;
}
// This matcher doesn't differentiate by method, so don't bother with those
// exceptions.
throw new ResourceNotFoundException();
}