Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PHP extensions: gd, mbstring, xml #681

Merged
merged 12 commits into from
Oct 12, 2023
Merged

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Oct 11, 2023

Adds support for loading arbitrary PHP extensions in the web version of
Playground using all three available APIs:

  • Query API: ?php-extension-bundle=kitchen-sink
  • Blueprints: { "phpExtensionBundles": [ "kitchen-sink" ] }

For now, it only switches between a barebones ~6MB PHP build and a
larger ~8MB with more extensions included. In the future, the internal
implementation will change and PHP extensions will be shipped and
downloaded separately – see #673

  1. Click the new "Load PHP extensions" checkbox in the configuration modal
  2. Go to /phpinfo.php and confirm that gd, xml, and mbstring extensions are now available
  3. Uncheck that checkbox
  4. Confirm these extensions are no longer loaded
CleanShot 2023-10-11 at 19 50 14@2x

Solves #655

cc @dmsnell @danielbachhuber @seanmorris

Adds support for loading arbitrary PHP extensions in the web version of
Playground using all three available APIs:

* Query API: `?php-extension=gd&php-extension=xml-bundle`
* Blueprints: `{ "phpExtensions": [ "gd", "xml-bundle" ] }`
* JavaScript API: `WebPHP.loadSync(phpVersion, { extensions: ["gd",
  "xml-bundle"]})`

For now, it only switches between a barebones ~6MB PHP build and a
larger ~8MB with more extensions included. In the future, the internal
implementation will change and PHP extensions will be shipped and
downloaded separately – see #673

1. Click the new "Load PHP extensions" checkbox in the configuration modal
2. Go to /phpinfo.php and confirm that `gd`, `xml`, and `mbstring` extensions are now available
3. Uncheck that checkbox
4. Confirm these extensions are no longer loaded
@adamziel adamziel self-assigned this Oct 11, 2023
@adamziel adamziel requested a review from a team as a code owner October 11, 2023 17:51
@adamziel adamziel changed the title Add/php extensions Support arbitrary PHP extensions Oct 11, 2023
@adamziel
Copy link
Collaborator Author

cc @tellyworth

@adamziel
Copy link
Collaborator Author

This seems to work well enough and unblocks previewing more advanced plugins. Let's merge!

@adamziel adamziel merged commit 84f1838 into trunk Oct 12, 2023
4 checks passed
@adamziel adamziel deleted the add/php-extensions branch October 12, 2023 08:25
adamziel added a commit that referenced this pull request Oct 12, 2023
… directory

This change wasn't included in #681 but should have been
adamziel added a commit that referenced this pull request Oct 12, 2023
## What is this PR doing?

Includes the `iconv` PHP extension in the kitchen-sink extension bundle,
see #681

This work was done by @seanmorris in Pull Request #639, I'm only
extracting it to a separate PR to ship it faster.

<img width="961" alt="CleanShot 2023-10-12 at 11 13 59@2x"
src="https://github.com/WordPress/wordpress-playground/assets/205419/a275ec51-e0fe-4e3d-8e66-b36987b2a57c">

## Test plan

1. In Playground, go to `/phpinfo.php`
2. Confirm the iconv extension is not loaded by default
3. Go to the customization modal, check "load additional PHP extensions"
4. Confirm the iconv extension is now listed on `/phpinfo.php`
@adamziel adamziel changed the title Support arbitrary PHP extensions Support PHP extensions: gd, mbstring, xml Oct 12, 2023
@adamziel adamziel changed the title Support PHP extensions: gd, mbstring, xml Support for PHP extensions: gd, mbstring, xml Oct 12, 2023
adamziel pushed a commit that referenced this pull request Oct 20, 2023
When the `php-extension-bundle` param was added in PR
#681, the `wp`
param was overwritten in the Query API documentation.

Keeps `php-extension-bundle` param and adds back the documentation
related to `wp` param.

Also added `beta` param as a selectable option for `wp` version param.
You can see this param in action here:

https://playground.wordpress.net/?wp=beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants