You are here

private function RequestSubscriber::reinitializeRequest in Persistent URL 8

Since the Request object is absent of APIs for modifying parts of the request, we will need to run its iniitalize method to make it do it itself. This will be done after a method plugin alters the server attributes i.e. $request->server->set('REQUEST_URI', '/new/uri')

I don't have a better solution that doesn't feel hacky.

1 call to RequestSubscriber::reinitializeRequest()
RequestSubscriber::onRequest in src/Event/RequestSubscriber.php

File

src/Event/RequestSubscriber.php, line 165

Class

RequestSubscriber
ALTERNATIVE APPROACH IS ENCAPSULATE METHOD PLUGIN LOGIC WITH A PATH PROCESSOR, AND DO MOST LOGIC WITHIN THE CONFINES OF Symfony\(Cmf\)?Routing

Namespace

Drupal\purl\Event

Code

private function reinitializeRequest(Request $request) {
  $request
    ->initialize($request->query
    ->all(), $request->request
    ->all(), $request->attributes
    ->all(), $request->cookies
    ->all(), $request->files
    ->all(), $request->server
    ->all(), $request
    ->getContent());
}