@wp-playground/wordpress 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/boot.d.ts CHANGED
@@ -9,6 +9,7 @@ export interface Hooks {
9
9
  export type DatabaseType = 'sqlite' | 'mysql' | 'custom';
10
10
  export interface BootOptions {
11
11
  createPhpRuntime: () => Promise<number>;
12
+ onPHPInstanceCreated?: (php: PHP) => Promise<void>;
12
13
  /**
13
14
  * Mounting and Copying is handled via hooks for starters.
14
15
  *
@@ -99,6 +100,7 @@ export interface BootOptions {
99
100
  * @return PHPRequestHandler instance with WordPress installed.
100
101
  */
101
102
  export declare function bootWordPress(options: BootOptions): Promise<PHPRequestHandler>;
103
+ export declare function bootRequestHandler(options: BootOptions): Promise<PHPRequestHandler>;
102
104
  /**
103
105
  * Checks if WordPress is installed by checking if the wp-load.php file exists
104
106
  * and if the blog is installed.
package/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@php-wasm/util"),p=require("@wp-playground/common"),l=require("@php-wasm/universal"),P=require("@php-wasm/logger"),k=`<?php
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@php-wasm/util"),d=require("@wp-playground/common"),s=require("@php-wasm/universal"),k=require("@php-wasm/logger"),E=`<?php
2
2
 
3
3
  /**
4
4
  * Rewrites the wp-config.php file to ensure specific constants are defined
@@ -343,16 +343,16 @@ function skip_whitespace($tokens) {
343
343
  }
344
344
  return $output;
345
345
  }
346
- `;async function _(e,r,t,n="rewrite"){const o=i.phpVars({wpConfigPath:r,constants:t,whenAlreadyDefined:n});if((await e.run({code:`<?php ob_start(); ?>
347
- ${k}
348
- $wp_config_path = ${o.wpConfigPath};
346
+ `;async function f(e,i,n,t="rewrite"){const a=r.phpVars({wpConfigPath:i,constants:n,whenAlreadyDefined:t});if((await e.run({code:`<?php ob_start(); ?>
347
+ ${E}
348
+ $wp_config_path = ${a.wpConfigPath};
349
349
  $wp_config = file_get_contents($wp_config_path);
350
- $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${o.constants}, ${o.whenAlreadyDefined});
350
+ $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${a.constants}, ${a.whenAlreadyDefined});
351
351
  $return_value = file_put_contents($wp_config_path, $new_wp_config);
352
352
  ob_clean();
353
353
  echo false === $return_value ? '0' : '1';
354
354
  ob_end_flush();
355
- `})).text!=="1")throw new Error("Failed to rewrite constants in wp-config.php.")}async function c(e,r){const t=i.joinPaths(r,"wp-config.php"),n={DB_NAME:"wordpress"};!e.fileExists(t)&&e.fileExists(i.joinPaths(r,"wp-config-sample.php"))&&await e.writeFile(t,await e.readFileAsBuffer(i.joinPaths(r,"wp-config-sample.php"))),await _(e,t,n,"skip")}async function E(e){var o,d;async function r(a,u){const s=new l.PHP(await e.createPhpRuntime());return e.sapiName&&s.setSapiName(e.sapiName),a&&(s.requestHandler=a),e.phpIniEntries&&l.setPhpIniEntries(s,e.phpIniEntries),u?(await w(s),await l.writeFiles(s,"/",e.createFiles||{}),await m(s,i.joinPaths(new URL(e.siteUrl).pathname,"phpinfo.php"))):l.proxyFileSystem(await a.getPrimaryPhp(),s,["/tmp",a.documentRoot,"/internal/shared"]),e.spawnHandler&&await s.setSpawnHandler(e.spawnHandler(a.processManager)),l.rotatePHPRuntime({php:s,cwd:a.documentRoot,recreateRuntime:e.createPhpRuntime,maxRequests:400}),s}const t=new l.PHPRequestHandler({phpFactory:async({isPrimary:a})=>r(t,a),documentRoot:e.documentRoot||"/wordpress",absoluteUrl:e.siteUrl,rewriteRules:$,getFileNotFoundAction:e.getFileNotFoundAction??h,cookieStore:e.cookieStore}),n=await t.getPrimaryPhp();if((o=e.hooks)!=null&&o.beforeWordPressFiles&&await e.hooks.beforeWordPressFiles(n),e.wordPressZip&&await y(n,await e.wordPressZip),e.constants)for(const a in e.constants)n.defineConstant(a,e.constants[a]);if(n.defineConstant("WP_HOME",e.siteUrl),n.defineConstant("WP_SITEURL",e.siteUrl),await c(n,t.documentRoot),(d=e.hooks)!=null&&d.beforeDatabaseSetup&&await e.hooks.beforeDatabaseSetup(n),e.sqliteIntegrationPluginZip&&await b(n,await e.sqliteIntegrationPluginZip),await f(n)||await T(n),!await f(n))throw new Error("WordPress installation has failed.");return t}async function f(e){return(await e.run({code:`<?php
355
+ `})).text!=="1")throw new Error("Failed to rewrite constants in wp-config.php.")}async function _(e,i){const n=r.joinPaths(i,"wp-config.php"),t={DB_NAME:"wordpress"};!e.fileExists(n)&&e.fileExists(r.joinPaths(i,"wp-config-sample.php"))&&await e.writeFile(n,await e.readFileAsBuffer(r.joinPaths(i,"wp-config-sample.php"))),await f(e,n,t,"skip")}async function R(e){var t,a;const i=await c(e),n=await i.getPrimaryPhp();if((t=e.hooks)!=null&&t.beforeWordPressFiles&&await e.hooks.beforeWordPressFiles(n),e.wordPressZip&&await y(n,await e.wordPressZip),e.constants)for(const o in e.constants)n.defineConstant(o,e.constants[o]);if(e.dataSqlPath&&(n.defineConstant("DB_DIR",r.dirname(e.dataSqlPath)),n.defineConstant("DB_FILE",r.basename(e.dataSqlPath))),n.defineConstant("WP_HOME",e.siteUrl),n.defineConstant("WP_SITEURL",e.siteUrl),await _(n,i.documentRoot),(a=e.hooks)!=null&&a.beforeDatabaseSetup&&await e.hooks.beforeDatabaseSetup(n),e.sqliteIntegrationPluginZip&&await b(n,await e.sqliteIntegrationPluginZip),!e.dataSqlPath&&(await p(n)||await T(n),!await p(n)))throw new Error("WordPress installation has failed.");return i}async function c(e){async function i(t,a){const o=new s.PHP(await e.createPhpRuntime());return e.sapiName&&o.setSapiName(e.sapiName),t&&(o.requestHandler=t),e.phpIniEntries&&s.setPhpIniEntries(o,e.phpIniEntries),a?(await w(o),await s.writeFiles(o,"/",e.createFiles||{}),await m(o,r.joinPaths(new URL(e.siteUrl).pathname,"phpinfo.php"))):s.proxyFileSystem(await t.getPrimaryPhp(),o,["/tmp",t.documentRoot,"/internal/shared"]),e.spawnHandler&&await o.setSpawnHandler(e.spawnHandler(t.processManager)),s.rotatePHPRuntime({php:o,cwd:t.documentRoot,recreateRuntime:e.createPhpRuntime,maxRequests:400}),e.onPHPInstanceCreated&&await e.onPHPInstanceCreated(o),o}const n=new s.PHPRequestHandler({phpFactory:async({isPrimary:t})=>i(n,t),documentRoot:e.documentRoot||"/wordpress",absoluteUrl:e.siteUrl,rewriteRules:$,getFileNotFoundAction:e.getFileNotFoundAction??h,cookieStore:e.cookieStore});return n}async function p(e){return(await e.run({code:`<?php
356
356
  ob_start();
357
357
  $wp_load = getenv('DOCUMENT_ROOT') . '/wp-load.php';
358
358
  if (!file_exists($wp_load)) {
@@ -363,7 +363,7 @@ function skip_whitespace($tokens) {
363
363
  ob_clean();
364
364
  echo is_blog_installed() ? '1' : '0';
365
365
  ob_end_flush();
366
- `,env:{DOCUMENT_ROOT:e.documentRoot}})).text==="1"}async function T(e){await l.withPHPIniValues(e,{disable_functions:"fsockopen",allow_url_fopen:"0"},async()=>await e.request({url:"/wp-admin/install.php?step=2",method:"POST",body:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:"admin",admin_password:"password",admin_password2:"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})),(await e.run({code:`<?php
366
+ `,env:{DOCUMENT_ROOT:e.documentRoot}})).text==="1"}async function T(e){await s.withPHPIniValues(e,{disable_functions:"fsockopen",allow_url_fopen:"0"},async()=>await e.request({url:"/wp-admin/install.php?step=2",method:"POST",body:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:"admin",admin_password:"password",admin_password2:"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})),(await e.run({code:`<?php
367
367
  ob_start();
368
368
  $wp_load = getenv('DOCUMENT_ROOT') . '/wp-load.php';
369
369
  if (!file_exists($wp_load)) {
@@ -378,10 +378,10 @@ function skip_whitespace($tokens) {
378
378
  ob_clean();
379
379
  echo $option_result ? '1' : '0';
380
380
  ob_end_flush();
381
- `,env:{DOCUMENT_ROOT:e.documentRoot}})).text!=="1"&&P.logger.warn("Failed to default to pretty permalinks after WP install.")}function h(e){return{type:"internal-redirect",uri:"/index.php"}}async function R(e){const n=(await(await e.getPrimaryPhp()).run({code:`<?php
382
- require '${e.documentRoot}/wp-includes/version.php';
383
- echo $wp_version;
384
- `})).text;if(!n)throw new Error("Unable to read loaded WordPress version.");return g(n)}function g(e){if(/-(alpha|beta|RC)\d*-\d+$/.test(e))return"nightly";if(/-(beta|RC)\d*$/.test(e))return"beta";const n=e.match(/^(\d+\.\d+)(?:\.\d+)?$/);return n!==null?n[1]:e}const $=[{match:/^\/(.*?)(\/wp-(content|admin|includes)\/.*)/g,replacement:"$2"}];async function w(e){await e.mkdir("/internal/shared/mu-plugins"),await e.writeFile("/internal/shared/preload/env.php",`<?php
381
+ `,env:{DOCUMENT_ROOT:e.documentRoot}})).text!=="1"&&k.logger.warn("Failed to default to pretty permalinks after WP install.")}function h(e){return{type:"internal-redirect",uri:"/index.php"}}async function S(e){const{php:i,reap:n}=await e.processManager.acquirePHPInstance({considerPrimary:!0});try{const a=(await i.run({code:`<?php
382
+ require '${e.documentRoot}/wp-includes/version.php';
383
+ echo $wp_version;
384
+ `})).text;if(!a)throw new Error("Unable to read loaded WordPress version.");return g(a)}finally{n()}}function g(e){if(/-(alpha|beta|RC)\d*-\d+$/.test(e))return"nightly";if(/-(beta|RC)\d*$/.test(e))return"beta";const t=e.match(/^(\d+\.\d+)(?:\.\d+)?$/);return t!==null?t[1]:e}const $=[{match:/^\/(.*?)(\/wp-(content|admin|includes)\/.*)/g,replacement:"$2"}];async function w(e){await e.mkdir("/internal/shared/mu-plugins"),await e.writeFile("/internal/shared/preload/env.php",`<?php
385
385
 
386
386
  // Allow adding filters/actions prior to loading WordPress.
387
387
  // $function_to_add MUST be a string.
@@ -609,18 +609,18 @@ function skip_whitespace($tokens) {
609
609
  }
610
610
  return false;
611
611
  });
612
- })();`)}async function m(e,r="/phpinfo.php"){await e.writeFile("/internal/shared/preload/phpinfo.php",`<?php
612
+ })();`)}async function m(e,i="/phpinfo.php"){await e.writeFile("/internal/shared/preload/phpinfo.php",`<?php
613
613
  // Render PHPInfo if the requested page is /phpinfo.php
614
- if ( ${i.phpVar(r)} === $_SERVER['REQUEST_URI'] ) {
614
+ if ( isset($_SERVER['REQUEST_URI']) && ${r.phpVar(i)} === $_SERVER['REQUEST_URI'] ) {
615
615
  phpinfo();
616
616
  exit;
617
617
  }
618
- `)}async function b(e,r){await e.isDir("/tmp/sqlite-database-integration")&&await e.rmdir("/tmp/sqlite-database-integration",{recursive:!0}),await e.mkdir("/tmp/sqlite-database-integration"),await p.unzipFile(e,r,"/tmp/sqlite-database-integration");const t="/internal/shared/sqlite-database-integration",n=`/tmp/sqlite-database-integration/${(await e.listFiles("/tmp/sqlite-database-integration"))[0]}`;await e.mv(n,t),e.defineConstant("WP_SQLITE_AST_DRIVER",!0),await e.defineConstant("SQLITE_MAIN_FILE","1");const d=(await e.readFileAsText(i.joinPaths(t,"db.copy"))).replace("'{SQLITE_IMPLEMENTATION_FOLDER_PATH}'",i.phpVar(t)).replace("'{SQLITE_PLUGIN}'",i.phpVar(i.joinPaths(t,"load.php"))),a=i.joinPaths(await e.documentRoot,"wp-content/db.php"),u=`<?php
618
+ `)}async function b(e,i){await e.isDir("/tmp/sqlite-database-integration")&&await e.rmdir("/tmp/sqlite-database-integration",{recursive:!0}),await e.mkdir("/tmp/sqlite-database-integration"),await d.unzipFile(e,i,"/tmp/sqlite-database-integration");const n="/internal/shared/sqlite-database-integration",t=`/tmp/sqlite-database-integration/${(await e.listFiles("/tmp/sqlite-database-integration"))[0]}`;await e.mv(t,n),e.defineConstant("WP_SQLITE_AST_DRIVER",!0),await e.defineConstant("SQLITE_MAIN_FILE","1");const o=(await e.readFileAsText(r.joinPaths(n,"db.copy"))).replace("'{SQLITE_IMPLEMENTATION_FOLDER_PATH}'",r.phpVar(n)).replace("'{SQLITE_PLUGIN}'",r.phpVar(r.joinPaths(n,"load.php"))),P=r.joinPaths(await e.documentRoot,"wp-content/db.php"),l=`<?php
619
619
  // Do not preload this if WordPress comes with a custom db.php file.
620
- if(file_exists(${i.phpVar(a)})) {
620
+ if(file_exists(${r.phpVar(P)})) {
621
621
  return;
622
622
  }
623
- ?>`,s="/internal/shared/mu-plugins/sqlite-database-integration.php";await e.writeFile(s,u+d),await e.writeFile("/internal/shared/preload/0-sqlite.php",u+`<?php
623
+ ?>`,u="/internal/shared/mu-plugins/sqlite-database-integration.php";await e.writeFile(u,l+o),await e.writeFile("/internal/shared/preload/0-sqlite.php",l+`<?php
624
624
 
625
625
  /**
626
626
  * Loads the SQLite integration plugin before WordPress is loaded
@@ -670,7 +670,7 @@ class Playground_SQLite_Integration_Loader {
670
670
  $GLOBALS['wpdb']->$name = $value;
671
671
  }
672
672
  protected function load_sqlite_integration() {
673
- require_once ${i.phpVar(s)};
673
+ require_once ${r.phpVar(u)};
674
674
  }
675
675
  }
676
676
  $wpdb = $GLOBALS['wpdb'] = new Playground_SQLite_Integration_Loader();
@@ -692,5 +692,5 @@ if(!function_exists('mysqli_connect')) {
692
692
  var_dump(isset($wpdb));
693
693
  die("SQLite integration not loaded " . get_class($wpdb));
694
694
  }
695
- `)}async function y(e,r){e.mkdir("/tmp/unzipped-wordpress"),await p.unzipFile(e,r,"/tmp/unzipped-wordpress"),e.fileExists("/tmp/unzipped-wordpress/wordpress.zip")&&await p.unzipFile(e,"/tmp/unzipped-wordpress/wordpress.zip","/tmp/unzipped-wordpress");let t=e.fileExists("/tmp/unzipped-wordpress/wordpress")?"/tmp/unzipped-wordpress/wordpress":e.fileExists("/tmp/unzipped-wordpress/build")?"/tmp/unzipped-wordpress/build":"/tmp/unzipped-wordpress";if(!e.fileExists(i.joinPaths(t,"wp-config-sample.php"))){const n=e.listFiles(t);if(n.length){const o=n[0];e.fileExists(i.joinPaths(t,o,"wp-config-sample.php"))&&(t=i.joinPaths(t,o))}}if(e.isDir(e.documentRoot)&&S(e.documentRoot,e)){for(const n of e.listFiles(t)){const o=i.joinPaths(t,n),d=i.joinPaths(e.documentRoot,n);e.mv(o,d)}e.rmdir(t,{recursive:!0})}else e.mv(t,e.documentRoot);!e.fileExists(i.joinPaths(e.documentRoot,"wp-config.php"))&&e.fileExists(i.joinPaths(e.documentRoot,"wp-config-sample.php"))&&e.writeFile(i.joinPaths(e.documentRoot,"wp-config.php"),e.readFileAsText(i.joinPaths(e.documentRoot,"/wp-config-sample.php")))}function S(e,r){const t=r.listFiles(e);return t.length===0||t.length===1&&t[0]==="playground-site-metadata.json"}const v=p.createMemoizedFetch(fetch);async function L(e="latest"){if(e.startsWith("https://")||e.startsWith("http://")){const n=await crypto.subtle.digest("SHA-1",new TextEncoder().encode(e)),o=Array.from(new Uint8Array(n)).map(d=>d.toString(16).padStart(2,"0")).join("");return{releaseUrl:e,version:"custom-"+o.substring(0,8),source:"inferred"}}else if(e==="trunk"||e==="nightly")return{releaseUrl:"https://wordpress.org/nightly-builds/wordpress-latest.zip",version:"nightly-"+new Date().toISOString().split("T")[0],source:"inferred"};let t=await(await v("https://api.wordpress.org/core/version-check/1.7/?channel=beta")).json();t=t.offers.filter(n=>n.response==="autoupdate");for(const n of t){if(e==="beta"&&n.version.includes("beta"))return{releaseUrl:n.download,version:n.version,source:"api"};if(e==="latest"&&!n.version.includes("beta"))return{releaseUrl:n.download,version:n.version,source:"api"};if(n.version.substring(0,e.length)===e)return{releaseUrl:n.download,version:n.version,source:"api"}}return{releaseUrl:`https://wordpress.org/wordpress-${e}.zip`,version:e,source:"inferred"}}exports.bootWordPress=E;exports.defineWpConfigConstants=_;exports.ensureWpConfig=c;exports.getFileNotFoundActionForWordPress=h;exports.getLoadedWordPressVersion=R;exports.preloadPhpInfoRoute=m;exports.preloadSqliteIntegration=b;exports.resolveWordPressRelease=L;exports.setupPlatformLevelMuPlugins=w;exports.unzipWordPress=y;exports.versionStringToLoadedWordPressVersion=g;exports.wordPressRewriteRules=$;
695
+ `)}async function y(e,i){e.mkdir("/tmp/unzipped-wordpress"),await d.unzipFile(e,i,"/tmp/unzipped-wordpress"),e.fileExists("/tmp/unzipped-wordpress/wordpress.zip")&&await d.unzipFile(e,"/tmp/unzipped-wordpress/wordpress.zip","/tmp/unzipped-wordpress");let n=e.fileExists("/tmp/unzipped-wordpress/wordpress")?"/tmp/unzipped-wordpress/wordpress":e.fileExists("/tmp/unzipped-wordpress/build")?"/tmp/unzipped-wordpress/build":"/tmp/unzipped-wordpress";if(!e.fileExists(r.joinPaths(n,"wp-config-sample.php"))){const t=e.listFiles(n);if(t.length){const a=t[0];e.fileExists(r.joinPaths(n,a,"wp-config-sample.php"))&&(n=r.joinPaths(n,a))}}if(e.isDir(e.documentRoot)&&v(e.documentRoot,e)){for(const t of e.listFiles(n)){const a=r.joinPaths(n,t),o=r.joinPaths(e.documentRoot,t);e.mv(a,o)}e.rmdir(n,{recursive:!0})}else e.mv(n,e.documentRoot);!e.fileExists(r.joinPaths(e.documentRoot,"wp-config.php"))&&e.fileExists(r.joinPaths(e.documentRoot,"wp-config-sample.php"))&&e.writeFile(r.joinPaths(e.documentRoot,"wp-config.php"),e.readFileAsText(r.joinPaths(e.documentRoot,"/wp-config-sample.php")))}function v(e,i){const n=i.listFiles(e);return n.length===0||n.length===1&&n[0]==="playground-site-metadata.json"}const L=d.createMemoizedFetch(fetch);async function x(e="latest"){if(e.startsWith("https://")||e.startsWith("http://")){const t=await crypto.subtle.digest("SHA-1",new TextEncoder().encode(e)),a=Array.from(new Uint8Array(t)).map(o=>o.toString(16).padStart(2,"0")).join("");return{releaseUrl:e,version:"custom-"+a.substring(0,8),source:"inferred"}}else if(e==="trunk"||e==="nightly")return{releaseUrl:"https://wordpress.org/nightly-builds/wordpress-latest.zip",version:"nightly-"+new Date().toISOString().split("T")[0],source:"inferred"};let n=await(await L("https://api.wordpress.org/core/version-check/1.7/?channel=beta")).json();n=n.offers.filter(t=>t.response==="autoupdate");for(const t of n){if(e==="beta"&&t.version.includes("beta"))return{releaseUrl:t.download,version:t.version,source:"api"};if(e==="latest"&&!t.version.includes("beta"))return{releaseUrl:t.download,version:t.version,source:"api"};if(t.version.substring(0,e.length)===e)return{releaseUrl:t.download,version:t.version,source:"api"}}return{releaseUrl:`https://wordpress.org/wordpress-${e}.zip`,version:e,source:"inferred"}}exports.bootRequestHandler=c;exports.bootWordPress=R;exports.defineWpConfigConstants=f;exports.ensureWpConfig=_;exports.getFileNotFoundActionForWordPress=h;exports.getLoadedWordPressVersion=S;exports.preloadPhpInfoRoute=m;exports.preloadSqliteIntegration=b;exports.resolveWordPressRelease=x;exports.setupPlatformLevelMuPlugins=w;exports.unzipWordPress=y;exports.versionStringToLoadedWordPressVersion=g;exports.wordPressRewriteRules=$;
696
696
  //# sourceMappingURL=index.cjs.map
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { PHP, UniversalPHP } from '@php-wasm/universal';
2
- export { bootWordPress, getFileNotFoundActionForWordPress } from './boot';
2
+ export { bootWordPress, bootRequestHandler, getFileNotFoundActionForWordPress, } from './boot';
3
3
  export { defineWpConfigConstants, ensureWpConfig } from './rewrite-wp-config';
4
4
  export { getLoadedWordPressVersion } from './version-detect';
5
5
  export * from './version-detect';
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { phpVars as _, joinPaths as r, phpVar as l } from "@php-wasm/util";
2
- import { createMemoizedFetch as c, unzipFile as p } from "@wp-playground/common";
3
- import { PHPRequestHandler as h, PHP as g, setPhpIniEntries as $, writeFiles as w, proxyFileSystem as m, rotatePHPRuntime as b, withPHPIniValues as y } from "@php-wasm/universal";
4
- import { logger as k } from "@php-wasm/logger";
5
- const P = `<?php
1
+ import { phpVars as _, joinPaths as o, dirname as c, basename as h, phpVar as s } from "@php-wasm/util";
2
+ import { createMemoizedFetch as g, unzipFile as d } from "@wp-playground/common";
3
+ import { PHPRequestHandler as $, withPHPIniValues as w, PHP as m, setPhpIniEntries as b, writeFiles as y, proxyFileSystem as k, rotatePHPRuntime as P } from "@php-wasm/universal";
4
+ import { logger as E } from "@php-wasm/logger";
5
+ const T = `<?php
6
6
 
7
7
  /**
8
8
  * Rewrites the wp-config.php file to ensure specific constants are defined
@@ -348,14 +348,14 @@ function skip_whitespace($tokens) {
348
348
  return $output;
349
349
  }
350
350
  `;
351
- async function E(e, i, t, n = "rewrite") {
352
- const o = _({ wpConfigPath: i, constants: t, whenAlreadyDefined: n });
351
+ async function R(e, i, n, t = "rewrite") {
352
+ const a = _({ wpConfigPath: i, constants: n, whenAlreadyDefined: t });
353
353
  if ((await e.run({
354
354
  code: `<?php ob_start(); ?>
355
- ${P}
356
- $wp_config_path = ${o.wpConfigPath};
355
+ ${T}
356
+ $wp_config_path = ${a.wpConfigPath};
357
357
  $wp_config = file_get_contents($wp_config_path);
358
- $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${o.constants}, ${o.whenAlreadyDefined});
358
+ $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${a.constants}, ${a.whenAlreadyDefined});
359
359
  $return_value = file_put_contents($wp_config_path, $new_wp_config);
360
360
  ob_clean();
361
361
  echo false === $return_value ? '0' : '1';
@@ -364,56 +364,60 @@ async function E(e, i, t, n = "rewrite") {
364
364
  })).text !== "1")
365
365
  throw new Error("Failed to rewrite constants in wp-config.php.");
366
366
  }
367
- async function T(e, i) {
368
- const t = r(i, "wp-config.php"), n = {
367
+ async function S(e, i) {
368
+ const n = o(i, "wp-config.php"), t = {
369
369
  DB_NAME: "wordpress"
370
370
  };
371
- !e.fileExists(t) && e.fileExists(r(i, "wp-config-sample.php")) && await e.writeFile(
372
- t,
371
+ !e.fileExists(n) && e.fileExists(o(i, "wp-config-sample.php")) && await e.writeFile(
372
+ n,
373
373
  await e.readFileAsBuffer(
374
- r(i, "wp-config-sample.php")
374
+ o(i, "wp-config-sample.php")
375
375
  )
376
- ), await E(e, t, n, "skip");
376
+ ), await R(e, n, t, "skip");
377
377
  }
378
- async function N(e) {
379
- var o, d;
380
- async function i(a, u) {
381
- const s = new g(await e.createPhpRuntime());
382
- return e.sapiName && s.setSapiName(e.sapiName), a && (s.requestHandler = a), e.phpIniEntries && $(s, e.phpIniEntries), u ? (await L(s), await w(s, "/", e.createFiles || {}), await I(
383
- s,
384
- r(new URL(e.siteUrl).pathname, "phpinfo.php")
385
- )) : m(await a.getPrimaryPhp(), s, [
378
+ async function M(e) {
379
+ var t, a;
380
+ const i = await v(e), n = await i.getPrimaryPhp();
381
+ if ((t = e.hooks) != null && t.beforeWordPressFiles && await e.hooks.beforeWordPressFiles(n), e.wordPressZip && await D(n, await e.wordPressZip), e.constants)
382
+ for (const r in e.constants)
383
+ n.defineConstant(r, e.constants[r]);
384
+ if (e.dataSqlPath && (n.defineConstant("DB_DIR", c(e.dataSqlPath)), n.defineConstant("DB_FILE", h(e.dataSqlPath))), n.defineConstant("WP_HOME", e.siteUrl), n.defineConstant("WP_SITEURL", e.siteUrl), await S(n, i.documentRoot), (a = e.hooks) != null && a.beforeDatabaseSetup && await e.hooks.beforeDatabaseSetup(n), e.sqliteIntegrationPluginZip && await C(
385
+ n,
386
+ await e.sqliteIntegrationPluginZip
387
+ ), !e.dataSqlPath && (await p(n) || await L(n), !await p(n)))
388
+ throw new Error("WordPress installation has failed.");
389
+ return i;
390
+ }
391
+ async function v(e) {
392
+ async function i(t, a) {
393
+ const r = new m(await e.createPhpRuntime());
394
+ return e.sapiName && r.setSapiName(e.sapiName), t && (r.requestHandler = t), e.phpIniEntries && b(r, e.phpIniEntries), a ? (await W(r), await y(r, "/", e.createFiles || {}), await O(
395
+ r,
396
+ o(new URL(e.siteUrl).pathname, "phpinfo.php")
397
+ )) : k(await t.getPrimaryPhp(), r, [
386
398
  "/tmp",
387
- a.documentRoot,
399
+ t.documentRoot,
388
400
  "/internal/shared"
389
- ]), e.spawnHandler && await s.setSpawnHandler(
390
- e.spawnHandler(a.processManager)
391
- ), b({
392
- php: s,
393
- cwd: a.documentRoot,
401
+ ]), e.spawnHandler && await r.setSpawnHandler(
402
+ e.spawnHandler(t.processManager)
403
+ ), P({
404
+ php: r,
405
+ cwd: t.documentRoot,
394
406
  recreateRuntime: e.createPhpRuntime,
395
407
  maxRequests: 400
396
- }), s;
408
+ }), e.onPHPInstanceCreated && await e.onPHPInstanceCreated(r), r;
397
409
  }
398
- const t = new h({
399
- phpFactory: async ({ isPrimary: a }) => i(t, a),
410
+ const n = new $({
411
+ phpFactory: async ({ isPrimary: t }) => i(n, t),
400
412
  documentRoot: e.documentRoot || "/wordpress",
401
413
  absoluteUrl: e.siteUrl,
402
- rewriteRules: x,
403
- getFileNotFoundAction: e.getFileNotFoundAction ?? S,
414
+ rewriteRules: U,
415
+ getFileNotFoundAction: e.getFileNotFoundAction ?? x,
404
416
  cookieStore: e.cookieStore
405
- }), n = await t.getPrimaryPhp();
406
- if ((o = e.hooks) != null && o.beforeWordPressFiles && await e.hooks.beforeWordPressFiles(n), e.wordPressZip && await W(n, await e.wordPressZip), e.constants)
407
- for (const a in e.constants)
408
- n.defineConstant(a, e.constants[a]);
409
- if (n.defineConstant("WP_HOME", e.siteUrl), n.defineConstant("WP_SITEURL", e.siteUrl), await T(n, t.documentRoot), (d = e.hooks) != null && d.beforeDatabaseSetup && await e.hooks.beforeDatabaseSetup(n), e.sqliteIntegrationPluginZip && await U(
410
- n,
411
- await e.sqliteIntegrationPluginZip
412
- ), await f(n) || await R(n), !await f(n))
413
- throw new Error("WordPress installation has failed.");
414
- return t;
417
+ });
418
+ return n;
415
419
  }
416
- async function f(e) {
420
+ async function p(e) {
417
421
  return (await e.run({
418
422
  code: `<?php
419
423
  ob_start();
@@ -432,8 +436,8 @@ async function f(e) {
432
436
  }
433
437
  })).text === "1";
434
438
  }
435
- async function R(e) {
436
- await y(
439
+ async function L(e) {
440
+ await w(
437
441
  e,
438
442
  {
439
443
  disable_functions: "fsockopen",
@@ -475,40 +479,47 @@ async function R(e) {
475
479
  env: {
476
480
  DOCUMENT_ROOT: e.documentRoot
477
481
  }
478
- })).text !== "1" && k.warn("Failed to default to pretty permalinks after WP install.");
482
+ })).text !== "1" && E.warn("Failed to default to pretty permalinks after WP install.");
479
483
  }
480
- function S(e) {
484
+ function x(e) {
481
485
  return {
482
486
  type: "internal-redirect",
483
487
  uri: "/index.php"
484
488
  };
485
489
  }
486
- async function q(e) {
487
- const n = (await (await e.getPrimaryPhp()).run({
488
- code: `<?php
489
- require '${e.documentRoot}/wp-includes/version.php';
490
- echo $wp_version;
491
- `
492
- })).text;
493
- if (!n)
494
- throw new Error("Unable to read loaded WordPress version.");
495
- return v(n);
490
+ async function H(e) {
491
+ const { php: i, reap: n } = await e.processManager.acquirePHPInstance({
492
+ considerPrimary: !0
493
+ });
494
+ try {
495
+ const a = (await i.run({
496
+ code: `<?php
497
+ require '${e.documentRoot}/wp-includes/version.php';
498
+ echo $wp_version;
499
+ `
500
+ })).text;
501
+ if (!a)
502
+ throw new Error("Unable to read loaded WordPress version.");
503
+ return I(a);
504
+ } finally {
505
+ n();
506
+ }
496
507
  }
497
- function v(e) {
508
+ function I(e) {
498
509
  if (/-(alpha|beta|RC)\d*-\d+$/.test(e))
499
510
  return "nightly";
500
511
  if (/-(beta|RC)\d*$/.test(e))
501
512
  return "beta";
502
- const n = e.match(/^(\d+\.\d+)(?:\.\d+)?$/);
503
- return n !== null ? n[1] : e;
513
+ const t = e.match(/^(\d+\.\d+)(?:\.\d+)?$/);
514
+ return t !== null ? t[1] : e;
504
515
  }
505
- const x = [
516
+ const U = [
506
517
  {
507
518
  match: /^\/(.*?)(\/wp-(content|admin|includes)\/.*)/g,
508
519
  replacement: "$2"
509
520
  }
510
521
  ];
511
- async function L(e) {
522
+ async function W(e) {
512
523
  await e.mkdir("/internal/shared/mu-plugins"), await e.writeFile(
513
524
  "/internal/shared/preload/env.php",
514
525
  `<?php
@@ -751,41 +762,43 @@ async function L(e) {
751
762
  })();`
752
763
  );
753
764
  }
754
- async function I(e, i = "/phpinfo.php") {
765
+ async function O(e, i = "/phpinfo.php") {
755
766
  await e.writeFile(
756
767
  "/internal/shared/preload/phpinfo.php",
757
768
  `<?php
758
769
  // Render PHPInfo if the requested page is /phpinfo.php
759
- if ( ${l(i)} === $_SERVER['REQUEST_URI'] ) {
770
+ if ( isset($_SERVER['REQUEST_URI']) && ${s(
771
+ i
772
+ )} === $_SERVER['REQUEST_URI'] ) {
760
773
  phpinfo();
761
774
  exit;
762
775
  }
763
776
  `
764
777
  );
765
778
  }
766
- async function U(e, i) {
779
+ async function C(e, i) {
767
780
  await e.isDir("/tmp/sqlite-database-integration") && await e.rmdir("/tmp/sqlite-database-integration", {
768
781
  recursive: !0
769
- }), await e.mkdir("/tmp/sqlite-database-integration"), await p(e, i, "/tmp/sqlite-database-integration");
770
- const t = "/internal/shared/sqlite-database-integration", n = `/tmp/sqlite-database-integration/${(await e.listFiles("/tmp/sqlite-database-integration"))[0]}`;
771
- await e.mv(n, t), e.defineConstant("WP_SQLITE_AST_DRIVER", !0), await e.defineConstant("SQLITE_MAIN_FILE", "1");
772
- const d = (await e.readFileAsText(
773
- r(t, "db.copy")
782
+ }), await e.mkdir("/tmp/sqlite-database-integration"), await d(e, i, "/tmp/sqlite-database-integration");
783
+ const n = "/internal/shared/sqlite-database-integration", t = `/tmp/sqlite-database-integration/${(await e.listFiles("/tmp/sqlite-database-integration"))[0]}`;
784
+ await e.mv(t, n), e.defineConstant("WP_SQLITE_AST_DRIVER", !0), await e.defineConstant("SQLITE_MAIN_FILE", "1");
785
+ const r = (await e.readFileAsText(
786
+ o(n, "db.copy")
774
787
  )).replace(
775
788
  "'{SQLITE_IMPLEMENTATION_FOLDER_PATH}'",
776
- l(t)
789
+ s(n)
777
790
  ).replace(
778
791
  "'{SQLITE_PLUGIN}'",
779
- l(r(t, "load.php"))
780
- ), a = r(await e.documentRoot, "wp-content/db.php"), u = `<?php
792
+ s(o(n, "load.php"))
793
+ ), f = o(await e.documentRoot, "wp-content/db.php"), l = `<?php
781
794
  // Do not preload this if WordPress comes with a custom db.php file.
782
- if(file_exists(${l(a)})) {
795
+ if(file_exists(${s(f)})) {
783
796
  return;
784
797
  }
785
- ?>`, s = "/internal/shared/mu-plugins/sqlite-database-integration.php";
786
- await e.writeFile(s, u + d), await e.writeFile(
798
+ ?>`, u = "/internal/shared/mu-plugins/sqlite-database-integration.php";
799
+ await e.writeFile(u, l + r), await e.writeFile(
787
800
  "/internal/shared/preload/0-sqlite.php",
788
- u + `<?php
801
+ l + `<?php
789
802
 
790
803
  /**
791
804
  * Loads the SQLite integration plugin before WordPress is loaded
@@ -835,7 +848,7 @@ class Playground_SQLite_Integration_Loader {
835
848
  $GLOBALS['wpdb']->$name = $value;
836
849
  }
837
850
  protected function load_sqlite_integration() {
838
- require_once ${l(s)};
851
+ require_once ${s(u)};
839
852
  }
840
853
  }
841
854
  $wpdb = $GLOBALS['wpdb'] = new Playground_SQLite_Integration_Loader();
@@ -863,52 +876,52 @@ if(!function_exists('mysqli_connect')) {
863
876
  `
864
877
  );
865
878
  }
866
- async function W(e, i) {
867
- e.mkdir("/tmp/unzipped-wordpress"), await p(e, i, "/tmp/unzipped-wordpress"), e.fileExists("/tmp/unzipped-wordpress/wordpress.zip") && await p(
879
+ async function D(e, i) {
880
+ e.mkdir("/tmp/unzipped-wordpress"), await d(e, i, "/tmp/unzipped-wordpress"), e.fileExists("/tmp/unzipped-wordpress/wordpress.zip") && await d(
868
881
  e,
869
882
  "/tmp/unzipped-wordpress/wordpress.zip",
870
883
  "/tmp/unzipped-wordpress"
871
884
  );
872
- let t = e.fileExists("/tmp/unzipped-wordpress/wordpress") ? "/tmp/unzipped-wordpress/wordpress" : e.fileExists("/tmp/unzipped-wordpress/build") ? "/tmp/unzipped-wordpress/build" : "/tmp/unzipped-wordpress";
873
- if (!e.fileExists(r(t, "wp-config-sample.php"))) {
874
- const n = e.listFiles(t);
875
- if (n.length) {
876
- const o = n[0];
885
+ let n = e.fileExists("/tmp/unzipped-wordpress/wordpress") ? "/tmp/unzipped-wordpress/wordpress" : e.fileExists("/tmp/unzipped-wordpress/build") ? "/tmp/unzipped-wordpress/build" : "/tmp/unzipped-wordpress";
886
+ if (!e.fileExists(o(n, "wp-config-sample.php"))) {
887
+ const t = e.listFiles(n);
888
+ if (t.length) {
889
+ const a = t[0];
877
890
  e.fileExists(
878
- r(t, o, "wp-config-sample.php")
879
- ) && (t = r(t, o));
891
+ o(n, a, "wp-config-sample.php")
892
+ ) && (n = o(n, a));
880
893
  }
881
894
  }
882
- if (e.isDir(e.documentRoot) && O(e.documentRoot, e)) {
883
- for (const n of e.listFiles(t)) {
884
- const o = r(t, n), d = r(e.documentRoot, n);
885
- e.mv(o, d);
895
+ if (e.isDir(e.documentRoot) && A(e.documentRoot, e)) {
896
+ for (const t of e.listFiles(n)) {
897
+ const a = o(n, t), r = o(e.documentRoot, t);
898
+ e.mv(a, r);
886
899
  }
887
- e.rmdir(t, { recursive: !0 });
900
+ e.rmdir(n, { recursive: !0 });
888
901
  } else
889
- e.mv(t, e.documentRoot);
890
- !e.fileExists(r(e.documentRoot, "wp-config.php")) && e.fileExists(r(e.documentRoot, "wp-config-sample.php")) && e.writeFile(
891
- r(e.documentRoot, "wp-config.php"),
902
+ e.mv(n, e.documentRoot);
903
+ !e.fileExists(o(e.documentRoot, "wp-config.php")) && e.fileExists(o(e.documentRoot, "wp-config-sample.php")) && e.writeFile(
904
+ o(e.documentRoot, "wp-config.php"),
892
905
  e.readFileAsText(
893
- r(e.documentRoot, "/wp-config-sample.php")
906
+ o(e.documentRoot, "/wp-config-sample.php")
894
907
  )
895
908
  );
896
909
  }
897
- function O(e, i) {
898
- const t = i.listFiles(e);
899
- return t.length === 0 || t.length === 1 && // TODO: use a constant from a site storage package
900
- t[0] === "playground-site-metadata.json";
910
+ function A(e, i) {
911
+ const n = i.listFiles(e);
912
+ return n.length === 0 || n.length === 1 && // TODO: use a constant from a site storage package
913
+ n[0] === "playground-site-metadata.json";
901
914
  }
902
- const C = c(fetch);
903
- async function B(e = "latest") {
915
+ const F = g(fetch);
916
+ async function z(e = "latest") {
904
917
  if (e.startsWith("https://") || e.startsWith("http://")) {
905
- const n = await crypto.subtle.digest(
918
+ const t = await crypto.subtle.digest(
906
919
  "SHA-1",
907
920
  new TextEncoder().encode(e)
908
- ), o = Array.from(new Uint8Array(n)).map((d) => d.toString(16).padStart(2, "0")).join("");
921
+ ), a = Array.from(new Uint8Array(t)).map((r) => r.toString(16).padStart(2, "0")).join("");
909
922
  return {
910
923
  releaseUrl: e,
911
- version: "custom-" + o.substring(0, 8),
924
+ version: "custom-" + a.substring(0, 8),
912
925
  source: "inferred"
913
926
  };
914
927
  } else if (e === "trunk" || e === "nightly")
@@ -917,29 +930,29 @@ async function B(e = "latest") {
917
930
  version: "nightly-" + (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
918
931
  source: "inferred"
919
932
  };
920
- let t = await (await C(
933
+ let n = await (await F(
921
934
  "https://api.wordpress.org/core/version-check/1.7/?channel=beta"
922
935
  )).json();
923
- t = t.offers.filter(
924
- (n) => n.response === "autoupdate"
936
+ n = n.offers.filter(
937
+ (t) => t.response === "autoupdate"
925
938
  );
926
- for (const n of t) {
927
- if (e === "beta" && n.version.includes("beta"))
939
+ for (const t of n) {
940
+ if (e === "beta" && t.version.includes("beta"))
928
941
  return {
929
- releaseUrl: n.download,
930
- version: n.version,
942
+ releaseUrl: t.download,
943
+ version: t.version,
931
944
  source: "api"
932
945
  };
933
- if (e === "latest" && !n.version.includes("beta"))
946
+ if (e === "latest" && !t.version.includes("beta"))
934
947
  return {
935
- releaseUrl: n.download,
936
- version: n.version,
948
+ releaseUrl: t.download,
949
+ version: t.version,
937
950
  source: "api"
938
951
  };
939
- if (n.version.substring(0, e.length) === e)
952
+ if (t.version.substring(0, e.length) === e)
940
953
  return {
941
- releaseUrl: n.download,
942
- version: n.version,
954
+ releaseUrl: t.download,
955
+ version: t.version,
943
956
  source: "api"
944
957
  };
945
958
  }
@@ -950,17 +963,18 @@ async function B(e = "latest") {
950
963
  };
951
964
  }
952
965
  export {
953
- N as bootWordPress,
954
- E as defineWpConfigConstants,
955
- T as ensureWpConfig,
956
- S as getFileNotFoundActionForWordPress,
957
- q as getLoadedWordPressVersion,
958
- I as preloadPhpInfoRoute,
959
- U as preloadSqliteIntegration,
960
- B as resolveWordPressRelease,
961
- L as setupPlatformLevelMuPlugins,
962
- W as unzipWordPress,
963
- v as versionStringToLoadedWordPressVersion,
964
- x as wordPressRewriteRules
966
+ v as bootRequestHandler,
967
+ M as bootWordPress,
968
+ R as defineWpConfigConstants,
969
+ S as ensureWpConfig,
970
+ x as getFileNotFoundActionForWordPress,
971
+ H as getLoadedWordPressVersion,
972
+ O as preloadPhpInfoRoute,
973
+ C as preloadSqliteIntegration,
974
+ z as resolveWordPressRelease,
975
+ W as setupPlatformLevelMuPlugins,
976
+ D as unzipWordPress,
977
+ I as versionStringToLoadedWordPressVersion,
978
+ U as wordPressRewriteRules
965
979
  };
966
980
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/wordpress",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "WordPress-related plumbing for WordPress Playground",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,19 +35,20 @@
35
35
  "access": "public",
36
36
  "directory": "../../../dist/packages/playground/wordpress"
37
37
  },
38
- "gitHead": "59c2db1ec41efa10ffa01e6e1ea7ac6e78bc693e",
38
+ "gitHead": "ed646326d99ba84bad911d65b6634265f508f073",
39
39
  "dependencies": {
40
- "comlink": "^4.4.1",
40
+ "comlink": "^4.4.2",
41
41
  "express": "4.21.2",
42
+ "fs-ext": "2.1.1",
42
43
  "ini": "4.1.2",
43
44
  "wasm-feature-detect": "1.8.0",
44
45
  "ws": "8.18.1",
45
46
  "yargs": "17.7.2",
46
- "@php-wasm/universal": "1.1.2",
47
- "@php-wasm/util": "1.1.2",
48
- "@php-wasm/logger": "1.1.2",
49
- "@wp-playground/common": "1.1.2",
50
- "@php-wasm/node": "1.1.2"
47
+ "@php-wasm/universal": "1.1.4",
48
+ "@php-wasm/util": "1.1.4",
49
+ "@php-wasm/logger": "1.1.4",
50
+ "@wp-playground/common": "1.1.4",
51
+ "@php-wasm/node": "1.1.4"
51
52
  },
52
53
  "overrides": {
53
54
  "rollup": "^4.34.6",