@php-wasm/web 0.1.61 → 0.3.0

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.
Files changed (43) hide show
  1. package/.htaccess +0 -4
  2. package/README.md +4 -0
  3. package/index.d.ts +15 -19
  4. package/index.js +393 -371
  5. package/kitchen-sink/php_5_6.js +85 -0
  6. package/kitchen-sink/php_5_6.wasm +0 -0
  7. package/kitchen-sink/php_7_0.js +85 -0
  8. package/kitchen-sink/php_7_0.wasm +0 -0
  9. package/kitchen-sink/php_7_1.js +85 -0
  10. package/kitchen-sink/php_7_1.wasm +0 -0
  11. package/kitchen-sink/php_7_2.js +85 -0
  12. package/kitchen-sink/php_7_2.wasm +0 -0
  13. package/kitchen-sink/php_7_3.js +85 -0
  14. package/kitchen-sink/php_7_3.wasm +0 -0
  15. package/kitchen-sink/php_7_4.js +85 -0
  16. package/kitchen-sink/php_7_4.wasm +0 -0
  17. package/kitchen-sink/php_8_0.js +85 -0
  18. package/kitchen-sink/php_8_0.wasm +0 -0
  19. package/kitchen-sink/php_8_1.js +85 -0
  20. package/kitchen-sink/php_8_1.wasm +0 -0
  21. package/kitchen-sink/php_8_2.js +85 -0
  22. package/kitchen-sink/php_8_2.wasm +0 -0
  23. package/lib/worker-thread/spawn-php-worker-thread.d.ts +1 -9
  24. package/{php_5_6.js → light/php_5_6.js} +15 -1
  25. package/{php_5_6.wasm → light/php_5_6.wasm} +0 -0
  26. package/{php_7_0.js → light/php_7_0.js} +15 -1
  27. package/{php_7_0.wasm → light/php_7_0.wasm} +0 -0
  28. package/{php_7_1.js → light/php_7_1.js} +15 -1
  29. package/{php_7_1.wasm → light/php_7_1.wasm} +0 -0
  30. package/{php_7_2.js → light/php_7_2.js} +15 -1
  31. package/{php_7_2.wasm → light/php_7_2.wasm} +0 -0
  32. package/{php_7_3.js → light/php_7_3.js} +15 -1
  33. package/{php_7_3.wasm → light/php_7_3.wasm} +0 -0
  34. package/{php_7_4.js → light/php_7_4.js} +16 -2
  35. package/{php_7_4.wasm → light/php_7_4.wasm} +0 -0
  36. package/{php_8_0.js → light/php_8_0.js} +16 -2
  37. package/{php_8_0.wasm → light/php_8_0.wasm} +0 -0
  38. package/{php_8_1.js → light/php_8_1.js} +16 -2
  39. package/{php_8_1.wasm → light/php_8_1.wasm} +0 -0
  40. package/{php_8_2.js → light/php_8_2.js} +15 -1
  41. package/{php_8_2.wasm → light/php_8_2.wasm} +0 -0
  42. package/package.json +6 -2
  43. package/lib/worker-thread/parse-startup-options.d.ts +0 -1
@@ -63,8 +63,22 @@ if (PHPLoader.debug && typeof Asyncify !== "undefined") {
63
63
  }
64
64
  }
65
65
 
66
- PHPLoader.PATH = PATH;
67
-
66
+ /**
67
+ * Data dependencies call removeRunDependency() when they are loaded.
68
+ * The synchronous call stack then continues to run. If an error occurs
69
+ * in PHP initialization, e.g. Out Of Memory error, it will not be
70
+ * caught by any try/catch. This override propagates the failure to
71
+ * PHPLoader.onAbort() so that it can be handled.
72
+ */
73
+ const originalRemoveRunDependency = PHPLoader['removeRunDependency'];
74
+ PHPLoader['removeRunDependency'] = function (...args) {
75
+ try {
76
+ originalRemoveRunDependency(...args);
77
+ } catch (e) {
78
+ PHPLoader['onAbort'](e);
79
+ }
80
+ }
81
+
68
82
  return PHPLoader;
69
83
 
70
84
  // Close the opening bracket from esm-prefix.js:
@@ -62,8 +62,22 @@ if (PHPLoader.debug && typeof Asyncify !== "undefined") {
62
62
  return originalHandleSleep(startAsync);
63
63
  }
64
64
  }
65
-
66
- PHPLoader.PATH = PATH;
65
+
66
+ /**
67
+ * Data dependencies call removeRunDependency() when they are loaded.
68
+ * The synchronous call stack then continues to run. If an error occurs
69
+ * in PHP initialization, e.g. Out Of Memory error, it will not be
70
+ * caught by any try/catch. This override propagates the failure to
71
+ * PHPLoader.onAbort() so that it can be handled.
72
+ */
73
+ const originalRemoveRunDependency = PHPLoader['removeRunDependency'];
74
+ PHPLoader['removeRunDependency'] = function (...args) {
75
+ try {
76
+ originalRemoveRunDependency(...args);
77
+ } catch (e) {
78
+ PHPLoader['onAbort'](e);
79
+ }
80
+ }
67
81
 
68
82
  return PHPLoader;
69
83
 
@@ -1,6 +1,6 @@
1
1
  import dependencyFilename from './php_8_1.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 5653957;
3
+ export const dependenciesTotalSize = 5653952;
4
4
  export function init(RuntimeName, PHPLoader) {
5
5
  /**
6
6
  * Overrides Emscripten's default ExitStatus object which gets
@@ -63,7 +63,21 @@ if (PHPLoader.debug && typeof Asyncify !== "undefined") {
63
63
  }
64
64
  }
65
65
 
66
- PHPLoader.PATH = PATH;
66
+ /**
67
+ * Data dependencies call removeRunDependency() when they are loaded.
68
+ * The synchronous call stack then continues to run. If an error occurs
69
+ * in PHP initialization, e.g. Out Of Memory error, it will not be
70
+ * caught by any try/catch. This override propagates the failure to
71
+ * PHPLoader.onAbort() so that it can be handled.
72
+ */
73
+ const originalRemoveRunDependency = PHPLoader['removeRunDependency'];
74
+ PHPLoader['removeRunDependency'] = function (...args) {
75
+ try {
76
+ originalRemoveRunDependency(...args);
77
+ } catch (e) {
78
+ PHPLoader['onAbort'](e);
79
+ }
80
+ }
67
81
 
68
82
  return PHPLoader;
69
83
 
@@ -63,7 +63,21 @@ if (PHPLoader.debug && typeof Asyncify !== "undefined") {
63
63
  }
64
64
  }
65
65
 
66
- PHPLoader.PATH = PATH;
66
+ /**
67
+ * Data dependencies call removeRunDependency() when they are loaded.
68
+ * The synchronous call stack then continues to run. If an error occurs
69
+ * in PHP initialization, e.g. Out Of Memory error, it will not be
70
+ * caught by any try/catch. This override propagates the failure to
71
+ * PHPLoader.onAbort() so that it can be handled.
72
+ */
73
+ const originalRemoveRunDependency = PHPLoader['removeRunDependency'];
74
+ PHPLoader['removeRunDependency'] = function (...args) {
75
+ try {
76
+ originalRemoveRunDependency(...args);
77
+ } catch (e) {
78
+ PHPLoader['onAbort'](e);
79
+ }
80
+ }
67
81
 
68
82
  return PHPLoader;
69
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/web",
3
- "version": "0.1.61",
3
+ "version": "0.3.0",
4
4
  "description": "PHP.wasm for the web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,5 +29,9 @@
29
29
  "type": "module",
30
30
  "main": "index.js",
31
31
  "types": "index.d.ts",
32
- "gitHead": "f2cd7382004f7b003904b5db1d33d37fd2b1bfab"
32
+ "gitHead": "6890ff9243f9a10f0b86755fead101647a8c8535",
33
+ "engines": {
34
+ "node": ">=16.15.1",
35
+ "npm": ">=8.11.0"
36
+ }
33
37
  }
@@ -1 +0,0 @@
1
- export declare function parseWorkerStartupOptions<T extends Record<string, string>>(): T;