Drupal core currently generates headers and/or prints content directly in various places. With the introduction of HttpKernel and Response objects, these exit; calls should be eliminated. This is necessary in order to return properly formatted error pages, ensure event subscribers are called and to facilitate code testing (it can be difficult to execute tests on code that calls exit). Additionally, we are very close to having the ability to run Drupal as a long-running process, and/or fork drupal processes to handle sub-requests and one of the few remaining steps is to eliminate exit; calls.
Replace exit calls with return. In instances where header/print was used to send content to the client, return an appropriately formed Response object. As the installer does not yet use the HttpKernel object, this proposed resolution does not cover/include the installer.
User interface changes
No user interface changes.
No API changes.
|FAILED: [[SimpleTest]]: [MySQL] 47,481 pass(es), 189 fail(s), and 181 exception(s).|
|FAILED: [[SimpleTest]]: [MySQL] 47,405 pass(es), 148 fail(s), and 137 exception(s).|
|FAILED: [[SimpleTest]]: [MySQL] 47,436 pass(es), 145 fail(s), and 127 exception(s).|
|FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/modules/system/tests/modules/form_test/form_test.module.|