@wp-playground/wordpress 3.1.35 → 3.1.38

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Two kinds of patches live here:
5
5
  *
6
- * * Full source-level rewrites that let WordPress 1.0–2.8 boot on
6
+ * * Full source-level rewrites that let WordPress 0.7–2.8 boot on
7
7
  * the PHP 5.2 WASM + SQLite stack. Entry point:
8
8
  * {@link patchWordPressSourceFiles}. Used from legacy-wp/legacy-boot.ts.
9
9
  * * A mysqli-check backport that lets WP 5.0–6.1 boot on SQLite.
@@ -56,7 +56,7 @@ export declare const LEGACY_WP_ERROR_REPORTING_PHP_EXPR = "E_ALL & ~8192 & ~2048
56
56
  * Patches WordPress source files for legacy version compatibility.
57
57
  *
58
58
  * Applies all necessary patches to make old WordPress versions
59
- * (1.0 through 2.8) work with modern PHP and the SQLite integration.
59
+ * (0.7 through 2.8) work with modern PHP and the SQLite integration.
60
60
  *
61
61
  * Called from legacy-wp/legacy-boot.ts; legacy boot path only.
62
62
  */
@@ -73,6 +73,9 @@ export declare function generateDbPhpContent(): string;
73
73
  /**
74
74
  * Post-install fixups for legacy WordPress.
75
75
  *
76
+ * Stage 0 (WP 0.7 only): delegates to the gated b2/cafelog fixups in
77
+ * wp-07-support.ts because WP 0.7 has b2* tables, not wp_* tables.
78
+ *
76
79
  * Stage 1 (always): boots WordPress and patches data via $wpdb —
77
80
  * siteurl/home, admin password, roles/caps, default content.
78
81
  *
@@ -15,4 +15,4 @@
15
15
  * Interpolated into the 0-sqlite.php preload built by
16
16
  * {@link buildLegacySqlitePreload} in legacy-sqlite-preload.ts.
17
17
  */
18
- export declare const MYSQL_SHIMS_PHP = "\n// Connection stubs \u2014 wpdb::__construct bails on a falsy return.\nif (!function_exists('mysqli_connect')) {\n\tfunction mysqli_connect() { return true; }\n}\nif (!function_exists('mysqli_init')) {\n\tfunction mysqli_init() { return true; }\n}\nif (!function_exists('mysql_connect')) {\n\tfunction mysql_connect() { return true; }\n}\nif (!function_exists('mysql_select_db')) {\n\tfunction mysql_select_db() { return true; }\n}\n// WordPress < 3.0 wpdb::__construct calls mysql_set_charset directly.\nif (!function_exists('mysql_set_charset')) {\n\tfunction mysql_set_charset() { return true; }\n}\n// Functional mysql_* stubs that delegate to $wpdb (SQLite driver).\n$GLOBALS['_mysql_results'] = array();\n$GLOBALS['_mysql_result_id'] = 0;\nif (!function_exists('mysql_query')) {\n\tfunction mysql_query($query, $link = null) {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && method_exists($wpdb, 'query')) {\n\t\t\t$wpdb->query($query);\n\t\t\tif (preg_match('/^\\s*(SELECT|SHOW|DESCRIBE|EXPLAIN)/i', $query)) {\n\t\t\t\t$rows = isset($wpdb->last_result) ? $wpdb->last_result : array();\n\t\t\t\t$id = ++$GLOBALS['_mysql_result_id'];\n\t\t\t\t$GLOBALS['_mysql_results'][$id] = array(\n\t\t\t\t\t'rows' => $rows,\n\t\t\t\t\t'index' => 0,\n\t\t\t\t);\n\t\t\t\treturn $id;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\nif (!function_exists('mysql_error')) {\n\tfunction mysql_error($link = null) {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && isset($wpdb->last_error)) {\n\t\t\treturn $wpdb->last_error;\n\t\t}\n\t\treturn '';\n\t}\n}\nif (!function_exists('mysql_list_tables')) {\n\tfunction mysql_list_tables($db = '', $link = null) {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && method_exists($wpdb, 'get_results')) {\n\t\t\t$tables = $wpdb->get_results(\n\t\t\t\t\"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name\"\n\t\t\t);\n\t\t\t$rows = array();\n\t\t\tif ($tables) {\n\t\t\t\tforeach ($tables as $t) {\n\t\t\t\t\t$obj = new stdClass();\n\t\t\t\t\t$obj->name = is_object($t) ? $t->name : $t['name'];\n\t\t\t\t\t$rows[] = $obj;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$id = ++$GLOBALS['_mysql_result_id'];\n\t\t\t$GLOBALS['_mysql_results'][$id] = array(\n\t\t\t\t'rows' => $rows,\n\t\t\t\t'index' => 0,\n\t\t\t);\n\t\t\treturn $id;\n\t\t}\n\t\treturn false;\n\t}\n}\nif (!function_exists('mysql_fetch_row')) {\n\tfunction mysql_fetch_row($result) {\n\t\tif (!isset($GLOBALS['_mysql_results'][$result])) return null;\n\t\t$r = &$GLOBALS['_mysql_results'][$result];\n\t\tif ($r['index'] >= count($r['rows'])) return null;\n\t\t$row = $r['rows'][$r['index']++];\n\t\treturn array_values((array)$row);\n\t}\n}\nif (!function_exists('mysql_fetch_object')) {\n\tfunction mysql_fetch_object($result) {\n\t\tif (!isset($GLOBALS['_mysql_results'][$result])) return null;\n\t\t$r = &$GLOBALS['_mysql_results'][$result];\n\t\tif ($r['index'] >= count($r['rows'])) return null;\n\t\treturn (object)(array)$r['rows'][$r['index']++];\n\t}\n}\nif (!function_exists('mysql_num_rows')) {\n\tfunction mysql_num_rows($result) {\n\t\tif (isset($GLOBALS['_mysql_results'][$result])) {\n\t\t\treturn count($GLOBALS['_mysql_results'][$result]['rows']);\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_get_server_info')) {\n\tfunction mysql_get_server_info() { return '8.0.0'; }\n}\nif (!function_exists('mysql_affected_rows')) {\n\tfunction mysql_affected_rows() {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && isset($wpdb->rows_affected)) {\n\t\t\treturn $wpdb->rows_affected;\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_insert_id')) {\n\tfunction mysql_insert_id() {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && isset($wpdb->insert_id)) {\n\t\t\treturn $wpdb->insert_id;\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_free_result')) {\n\tfunction mysql_free_result($result) {\n\t\tunset($GLOBALS['_mysql_results'][$result]);\n\t\treturn true;\n\t}\n}\nif (!function_exists('mysql_num_fields')) {\n\tfunction mysql_num_fields($result) {\n\t\tif (isset($GLOBALS['_mysql_results'][$result])\n\t\t\t&& !empty($GLOBALS['_mysql_results'][$result]['rows'])) {\n\t\t\treturn count((array)$GLOBALS['_mysql_results'][$result]['rows'][0]);\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_real_escape_string')) {\n\tfunction mysql_real_escape_string($s) { return addslashes($s); }\n}\nif (!function_exists('mysql_escape_string')) {\n\tfunction mysql_escape_string($s) { return addslashes($s); }\n}";
18
+ export declare const MYSQL_SHIMS_PHP = "\n// Connection stubs \u2014 wpdb::__construct bails on a falsy return.\nif (!function_exists('mysqli_connect')) {\n\tfunction mysqli_connect() { return true; }\n}\nif (!function_exists('mysqli_init')) {\n\tfunction mysqli_init() { return true; }\n}\nif (!function_exists('mysql_connect')) {\n\tfunction mysql_connect() { return true; }\n}\nif (!function_exists('mysql_select_db')) {\n\tfunction mysql_select_db() { return true; }\n}\n// WordPress < 3.0 wpdb::__construct calls mysql_set_charset directly.\nif (!function_exists('mysql_set_charset')) {\n\tfunction mysql_set_charset() { return true; }\n}\nif (!defined('MYSQL_ASSOC')) define('MYSQL_ASSOC', 1);\nif (!defined('MYSQL_NUM')) define('MYSQL_NUM', 2);\nif (!defined('MYSQL_BOTH')) define('MYSQL_BOTH', 3);\n// Functional mysql_* stubs that delegate to $wpdb (SQLite driver).\n$GLOBALS['_mysql_results'] = array();\n$GLOBALS['_mysql_result_id'] = 0;\nif (!function_exists('mysql_query')) {\n\tfunction mysql_query($query, $link = null) {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && method_exists($wpdb, 'query')) {\n\t\t\t$wpdb->query($query);\n\t\t\tif (preg_match('/^\\s*(SELECT|SHOW|DESCRIBE|EXPLAIN)/i', $query)) {\n\t\t\t\t$rows = isset($wpdb->last_result) ? $wpdb->last_result : array();\n\t\t\t\t$id = ++$GLOBALS['_mysql_result_id'];\n\t\t\t\t$GLOBALS['_mysql_results'][$id] = array(\n\t\t\t\t\t'rows' => $rows,\n\t\t\t\t\t'index' => 0,\n\t\t\t\t);\n\t\t\t\treturn $id;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\nif (!function_exists('mysql_error')) {\n\tfunction mysql_error($link = null) {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && isset($wpdb->last_error)) {\n\t\t\treturn $wpdb->last_error;\n\t\t}\n\t\treturn '';\n\t}\n}\nif (!function_exists('mysql_list_tables')) {\n\tfunction mysql_list_tables($db = '', $link = null) {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && method_exists($wpdb, 'get_results')) {\n\t\t\t$tables = $wpdb->get_results(\n\t\t\t\t\"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name\"\n\t\t\t);\n\t\t\t$rows = array();\n\t\t\tif ($tables) {\n\t\t\t\tforeach ($tables as $t) {\n\t\t\t\t\t$obj = new stdClass();\n\t\t\t\t\t$obj->name = is_object($t) ? $t->name : $t['name'];\n\t\t\t\t\t$rows[] = $obj;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$id = ++$GLOBALS['_mysql_result_id'];\n\t\t\t$GLOBALS['_mysql_results'][$id] = array(\n\t\t\t\t'rows' => $rows,\n\t\t\t\t'index' => 0,\n\t\t\t);\n\t\t\treturn $id;\n\t\t}\n\t\treturn false;\n\t}\n}\nif (!function_exists('mysql_fetch_row')) {\n\tfunction mysql_fetch_row($result) {\n\t\tif (!isset($GLOBALS['_mysql_results'][$result])) return null;\n\t\t$r = &$GLOBALS['_mysql_results'][$result];\n\t\tif ($r['index'] >= count($r['rows'])) return null;\n\t\t$row = $r['rows'][$r['index']++];\n\t\treturn array_values((array)$row);\n\t}\n}\nif (!function_exists('mysql_fetch_assoc')) {\n\tfunction mysql_fetch_assoc($result) {\n\t\tif (!isset($GLOBALS['_mysql_results'][$result])) return null;\n\t\t$r = &$GLOBALS['_mysql_results'][$result];\n\t\tif ($r['index'] >= count($r['rows'])) return null;\n\t\treturn (array)$r['rows'][$r['index']++];\n\t}\n}\nif (!function_exists('mysql_fetch_array')) {\n\tfunction mysql_fetch_array($result, $result_type = null) {\n\t\t$row = mysql_fetch_assoc($result);\n\t\tif ($row === null) return null;\n\t\tif ($result_type === MYSQL_ASSOC) return $row;\n\t\tif ($result_type === MYSQL_NUM) return array_values($row);\n\t\treturn array_merge(array_values($row), $row);\n\t}\n}\nif (!function_exists('mysql_fetch_object')) {\n\tfunction mysql_fetch_object($result) {\n\t\tif (!isset($GLOBALS['_mysql_results'][$result])) return null;\n\t\t$r = &$GLOBALS['_mysql_results'][$result];\n\t\tif ($r['index'] >= count($r['rows'])) return null;\n\t\treturn (object)(array)$r['rows'][$r['index']++];\n\t}\n}\nif (!function_exists('mysql_num_rows')) {\n\tfunction mysql_num_rows($result) {\n\t\tif (isset($GLOBALS['_mysql_results'][$result])) {\n\t\t\treturn count($GLOBALS['_mysql_results'][$result]['rows']);\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_get_server_info')) {\n\tfunction mysql_get_server_info() { return '8.0.0'; }\n}\nif (!function_exists('mysql_affected_rows')) {\n\tfunction mysql_affected_rows() {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && isset($wpdb->rows_affected)) {\n\t\t\treturn $wpdb->rows_affected;\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_insert_id')) {\n\tfunction mysql_insert_id() {\n\t\tglobal $wpdb;\n\t\tif (isset($wpdb) && isset($wpdb->insert_id)) {\n\t\t\treturn $wpdb->insert_id;\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_free_result')) {\n\tfunction mysql_free_result($result) {\n\t\tunset($GLOBALS['_mysql_results'][$result]);\n\t\treturn true;\n\t}\n}\nif (!function_exists('mysql_num_fields')) {\n\tfunction mysql_num_fields($result) {\n\t\tif (isset($GLOBALS['_mysql_results'][$result])\n\t\t\t&& !empty($GLOBALS['_mysql_results'][$result]['rows'])) {\n\t\t\treturn count((array)$GLOBALS['_mysql_results'][$result]['rows'][0]);\n\t\t}\n\t\treturn 0;\n\t}\n}\nif (!function_exists('mysql_real_escape_string')) {\n\tfunction mysql_real_escape_string($s) { return addslashes($s); }\n}\nif (!function_exists('mysql_escape_string')) {\n\tfunction mysql_escape_string($s) { return addslashes($s); }\n}";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Rewrites relative PHP include/require paths to paths relative to
3
+ * the file itself. Playground runs PHP requests with CWD set to the
4
+ * document root, while old WordPress admin scripts assume CWD is the
5
+ * script directory.
6
+ *
7
+ * Each pattern anchors the keyword to a non-word boundary (`(^|[^\w$])`)
8
+ * so identifiers that merely end in `require`/`include` — e.g.
9
+ * `my_require_once(...)` — are left untouched. A negative lookbehind
10
+ * would be cleaner but isn't supported on older Safari, so the boundary
11
+ * character is captured and re-emitted instead.
12
+ */
13
+ export declare function rewriteRelativePhpIncludes(content: string): string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * WordPress 0.7 compatibility.
3
+ *
4
+ * WP 0.71-gold still uses the b2/cafelog file layout: b2config.php,
5
+ * b2-include/, b2login.php, and b2* database tables. Keep those
6
+ * adaptations here so the regular legacy WP 1.0+ path stays focused on
7
+ * WordPress-shaped trees.
8
+ */
9
+ import type { PHP } from '@php-wasm/universal';
10
+ export declare function prepareWp07SourceTree(php: PHP, documentRoot: string): Promise<boolean>;
11
+ export declare function runWp07PostInstallFixups(php: PHP): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/wordpress",
3
- "version": "3.1.35",
3
+ "version": "3.1.38",
4
4
  "description": "WordPress-related plumbing for WordPress Playground",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,12 +35,12 @@
35
35
  "access": "public",
36
36
  "directory": "../../../dist/packages/playground/wordpress"
37
37
  },
38
- "gitHead": "9d29b73246e12465902d8ce42c0fe747125bc69a",
38
+ "gitHead": "2850a2a6f512e68e68407f4a9426dad705b426f0",
39
39
  "dependencies": {
40
- "@php-wasm/universal": "3.1.35",
41
- "@php-wasm/util": "3.1.35",
42
- "@php-wasm/logger": "3.1.35",
43
- "@wp-playground/common": "3.1.35"
40
+ "@php-wasm/universal": "3.1.38",
41
+ "@php-wasm/util": "3.1.38",
42
+ "@php-wasm/logger": "3.1.38",
43
+ "@wp-playground/common": "3.1.38"
44
44
  },
45
45
  "packageManager": "npm@10.9.2",
46
46
  "overrides": {
@@ -53,6 +53,7 @@
53
53
  "form-data": "^4.0.4",
54
54
  "lodash": "^4.17.23",
55
55
  "glob": "^9.3.0",
56
- "webpackbar": "^7.0.0"
56
+ "webpackbar": "^7.0.0",
57
+ "ws": "8.21.0"
57
58
  }
58
59
  }