You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
|`plugin`|| Installs the specified plugin. Use the plugin name from the plugins directory URL, e.g. for a URL like `https://wordpress.org/plugins/wp-lazy-loading/`, the plugin name would be `wp-lazy-loading`. You can pre-install multiple plugins by saying `plugin=coblocks&plugin=wp-lazy-loading&…`. Installing a plugin automatically logs the user in as an admin |
29
-
|`theme`|| Installs the specified theme. Use the theme name from the themes directory URL, e.g. for a URL like `https://wordpress.org/themes/disco/`, the theme name would be `disco`. Installing a theme automatically logs the user in as an admin |
30
-
|`url`|`/wp-admin/`| Load the specified initial page displaying WordPress |
31
-
|`mode`|`seamless`| Displays WordPress on a full-page or wraps it in a browser UI |
32
-
|`lazy`|| Defer loading the Playground assets until someone clicks on the "Run" button |
33
-
|`login`|`1`| Logs the user in as an admin |
34
-
|`gutenberg-pr`|| Loads the specified Gutenberg Pull Request |
35
-
|`storage`|| Selects the storage for Playground: `none` gets erased on page refresh, `browser` is stored in the browser, and `device` is stored in the selected directory on a device. The last two protect the user from accidentally losing their work upon page refresh. |
|`plugin`|| Installs the specified plugin. Use the plugin name from the plugins directory URL, e.g. for a URL like `https://wordpress.org/plugins/wp-lazy-loading/`, the plugin name would be `wp-lazy-loading`. You can pre-install multiple plugins by saying `plugin=coblocks&plugin=wp-lazy-loading&…`. Installing a plugin automatically logs the user in as an admin |
30
+
|`theme`|| Installs the specified theme. Use the theme name from the themes directory URL, e.g. for a URL like `https://wordpress.org/themes/disco/`, the theme name would be `disco`. Installing a theme automatically logs the user in as an admin |
31
+
|`url`|`/wp-admin/`| Load the specified initial page displaying WordPress |
32
+
|`mode`|`seamless`| Displays WordPress on a full-page or wraps it in a browser UI |
33
+
|`lazy`|| Defer loading the Playground assets until someone clicks on the "Run" button |
34
+
|`login`|`1`| Logs the user in as an admin |
35
+
|`gutenberg-pr`|| Loads the specified Gutenberg Pull Request |
36
+
|`storage`|| Selects the storage for Playground: `none` gets erased on page refresh, `browser` is stored in the browser, and `device` is stored in the selected directory on a device. The last two protect the user from accidentally losing their work upon page refresh. |
36
37
37
38
For example, the following code embeds a Playground with a preinstalled Gutenberg plugin, and opens the post editor:
Copy file name to clipboardExpand all lines: packages/docs/site/docs/09-blueprints-api/03-data-format.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,11 @@ import BlueprintExample from '@site/src/components/Blueprints/BlueprintExample.m
21
21
"php": "7.4",
22
22
"wp": "5.9"
23
23
},
24
+
"phpExtensions": [
25
+
"gd",
26
+
"xml-bundle",
27
+
"mbstring"
28
+
],
24
29
"steps": [
25
30
{
26
31
"step": "login",
@@ -48,3 +53,11 @@ The `preferredVersions` property, unsurprisingly, declares the preferred of PHP
48
53
49
54
-`php` (string): The preferred PHP version to use. Defaults to 'latest'. Only accepts major versions like "7.4" or "8.0". Minor versions like "7.4.1" are not supported.
50
55
-`wp` (string): The preferred WordPress version to use. Defaults to 'latest'. Only accepts major versions like "5.9" or "6.0". Minor versions like "5.9.1" are not supported.
56
+
57
+
## PHP extensions
58
+
59
+
The `phpExtensions` property is an array of PHP extensions to load. It can contain the following values:
60
+
61
+
-`gd`: Installs the GD extension.
62
+
-`xml-bundle`: Installs the XML bundle extension (libxml, xml, dom, simplexml, xmlreader, xmlwriter).
0 commit comments