Skip to content

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Apr 23, 2024

Warning

This is breaking change. We need it to support loopback requests.

Removes PHPBrowser, a decorator class over PHPRequestHandler whose sole task was to intercept, remember, and provide cookies for HTTP requests.

Having a class composition complicated the loopback request support PR and so thir PR introduces a CookieStore that does the same task at the PHPRequestHandler level

Migrating your codebase

  1. Remove any mentions of the PHPBrowser class from your code.
  2. Replace all mentions of the PHPBrowser type with PHPRequestHandler.
  3. Replace all mentions of the RequestHandler type with PHPRequestHandler.

It you manually initialize new PHPBrowser(), as in new PHPBrowser(new PHPRequestHandler()), just remove the wrapping new PHPBrowser() call and replace any references to the PHPBrowser type with PHPRequestHandler.

If you load things using the WebPHP.load() or NodePHP.load() API, you don't need to change anything.

Before merging

  1. Start a Changelog with a list of breaking changes.
  2. Document this PR in there.

Testing instructions

Confirm all the unit and E2E tests pass

@adamziel adamziel changed the title Remove PHPBrowser Breaking: Remove PHPBrowser Apr 23, 2024
Removes PHPBrowser, a decorator class over PHPRequestHandler whose sole task was to intercept, remember, and provide cookies for HTTP requests. Having a class composition complicated the loopback request support PR and so thir PR introduces a CookieStore that does the same task at the PHPRequestHandler level Related to #1287 ## Testing instructions Confirm all the unit and E2E tests pass
@adamziel adamziel force-pushed the remove-php-browser-2 branch from 18e70c0 to a6c5924 Compare April 23, 2024 18:34
@adamziel
Copy link
Collaborator Author

adamziel commented Apr 23, 2024

@sejas @kozer @wojtekn heads up this is coming, wp-now/studio may or may not require adjusting once it lands.

@adamziel adamziel force-pushed the remove-php-browser-2 branch from 3ec7c22 to eb631d1 Compare April 23, 2024 22:11
@adamziel adamziel requested a review from a team as a code owner April 23, 2024 22:11
@adamziel adamziel merged commit d85edd4 into trunk Apr 23, 2024
@adamziel adamziel deleted the remove-php-browser-2 branch April 23, 2024 22:30
@adamziel adamziel restored the remove-php-browser-2 branch April 23, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant