@php-wasm/web-8-2 3.1.20 → 3.1.22

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.
Binary file
package/jspi/php_8_2.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import dependencyFilename from './8_2_30/php_8_2.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 20465797;
3
+ export const dependenciesTotalSize = 20465796;
4
4
  const phpVersionString = '8.2.30';
5
5
  export function init(RuntimeName, PHPLoader) {
6
6
  // The rest of the code comes from the built php.js file and esm-suffix.js
@@ -7018,7 +7018,11 @@ export function init(RuntimeName, PHPLoader) {
7018
7018
  stdoutParentFd = std[1]?.parent,
7019
7019
  stderrChildFd = std[2]?.child,
7020
7020
  stderrParentFd = std[2]?.parent;
7021
+ const detachPipeDataListeners = [];
7021
7022
  cp.on('exit', function (code) {
7023
+ for (const detach of detachPipeDataListeners) {
7024
+ detach();
7025
+ }
7022
7026
  for (const fd of [stdoutChildFd, stderrChildFd, stdinChildFd]) {
7023
7027
  if (FS.streams[fd] && !FS.isClosed(FS.streams[fd])) {
7024
7028
  FS.close(FS.streams[fd]);
@@ -7030,30 +7034,46 @@ export function init(RuntimeName, PHPLoader) {
7030
7034
  if (stdoutChildFd) {
7031
7035
  const stdoutStream = SYSCALLS.getStreamFromFD(stdoutChildFd);
7032
7036
  let stdoutAt = 0;
7033
- cp.stdout.on('data', function (data) {
7034
- stdoutStream.stream_ops.write(
7035
- stdoutStream,
7036
- data,
7037
- 0,
7038
- data.length,
7039
- stdoutAt
7040
- );
7041
- stdoutAt += data.length;
7042
- });
7037
+ const onStdoutData = function (data) {
7038
+ try {
7039
+ stdoutStream.stream_ops.write(
7040
+ stdoutStream,
7041
+ data,
7042
+ 0,
7043
+ data.length,
7044
+ stdoutAt
7045
+ );
7046
+ stdoutAt += data.length;
7047
+ } catch {
7048
+ cp.stdout.off('data', onStdoutData);
7049
+ }
7050
+ };
7051
+ cp.stdout.on('data', onStdoutData);
7052
+ detachPipeDataListeners.push(() =>
7053
+ cp.stdout.off('data', onStdoutData)
7054
+ );
7043
7055
  }
7044
7056
  if (stderrChildFd) {
7045
7057
  const stderrStream = SYSCALLS.getStreamFromFD(stderrChildFd);
7046
7058
  let stderrAt = 0;
7047
- cp.stderr.on('data', function (data) {
7048
- stderrStream.stream_ops.write(
7049
- stderrStream,
7050
- data,
7051
- 0,
7052
- data.length,
7053
- stderrAt
7054
- );
7055
- stderrAt += data.length;
7056
- });
7059
+ const onStderrData = function (data) {
7060
+ try {
7061
+ stderrStream.stream_ops.write(
7062
+ stderrStream,
7063
+ data,
7064
+ 0,
7065
+ data.length,
7066
+ stderrAt
7067
+ );
7068
+ stderrAt += data.length;
7069
+ } catch {
7070
+ cp.stderr.off('data', onStderrData);
7071
+ }
7072
+ };
7073
+ cp.stderr.on('data', onStderrData);
7074
+ detachPipeDataListeners.push(() =>
7075
+ cp.stderr.off('data', onStderrData)
7076
+ );
7057
7077
  }
7058
7078
  try {
7059
7079
  await new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/web-8-2",
3
- "version": "3.1.20",
3
+ "version": "3.1.22",
4
4
  "description": "PHP 8.2 WebAssembly binaries for web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,11 +35,11 @@
35
35
  "node": ">=20.10.0",
36
36
  "npm": ">=10.2.3"
37
37
  },
38
- "gitHead": "98cfca0a050ef1dacce25710d6ebdf816e80b764",
38
+ "gitHead": "04c986b63dd56fe74e4ed0cf04d00cae7ac050bf",
39
39
  "dependencies": {
40
40
  "ini": "4.1.2",
41
41
  "wasm-feature-detect": "1.8.0",
42
- "@php-wasm/universal": "3.1.20"
42
+ "@php-wasm/universal": "3.1.22"
43
43
  },
44
44
  "packageManager": "npm@10.9.2",
45
45
  "overrides": {