@php-wasm/web-8-1 3.1.19 → 3.1.21

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
@@ -1,6 +1,6 @@
1
1
  import dependencyFilename from './8_1_34/php_8_1.wasm';
2
2
  export { dependencyFilename };
3
- export const dependenciesTotalSize = 20771586;
3
+ export const dependenciesTotalSize = 20775956;
4
4
  const phpVersionString = '8.1.34';
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
@@ -7147,7 +7147,11 @@ export function init(RuntimeName, PHPLoader) {
7147
7147
  stdoutParentFd = std[1]?.parent,
7148
7148
  stderrChildFd = std[2]?.child,
7149
7149
  stderrParentFd = std[2]?.parent;
7150
+ const detachPipeDataListeners = [];
7150
7151
  cp.on('exit', function (code) {
7152
+ for (const detach of detachPipeDataListeners) {
7153
+ detach();
7154
+ }
7151
7155
  for (const fd of [stdoutChildFd, stderrChildFd, stdinChildFd]) {
7152
7156
  if (FS.streams[fd] && !FS.isClosed(FS.streams[fd])) {
7153
7157
  FS.close(FS.streams[fd]);
@@ -7159,30 +7163,46 @@ export function init(RuntimeName, PHPLoader) {
7159
7163
  if (stdoutChildFd) {
7160
7164
  const stdoutStream = SYSCALLS.getStreamFromFD(stdoutChildFd);
7161
7165
  let stdoutAt = 0;
7162
- cp.stdout.on('data', function (data) {
7163
- stdoutStream.stream_ops.write(
7164
- stdoutStream,
7165
- data,
7166
- 0,
7167
- data.length,
7168
- stdoutAt
7169
- );
7170
- stdoutAt += data.length;
7171
- });
7166
+ const onStdoutData = function (data) {
7167
+ try {
7168
+ stdoutStream.stream_ops.write(
7169
+ stdoutStream,
7170
+ data,
7171
+ 0,
7172
+ data.length,
7173
+ stdoutAt
7174
+ );
7175
+ stdoutAt += data.length;
7176
+ } catch {
7177
+ cp.stdout.off('data', onStdoutData);
7178
+ }
7179
+ };
7180
+ cp.stdout.on('data', onStdoutData);
7181
+ detachPipeDataListeners.push(() =>
7182
+ cp.stdout.off('data', onStdoutData)
7183
+ );
7172
7184
  }
7173
7185
  if (stderrChildFd) {
7174
7186
  const stderrStream = SYSCALLS.getStreamFromFD(stderrChildFd);
7175
7187
  let stderrAt = 0;
7176
- cp.stderr.on('data', function (data) {
7177
- stderrStream.stream_ops.write(
7178
- stderrStream,
7179
- data,
7180
- 0,
7181
- data.length,
7182
- stderrAt
7183
- );
7184
- stderrAt += data.length;
7185
- });
7188
+ const onStderrData = function (data) {
7189
+ try {
7190
+ stderrStream.stream_ops.write(
7191
+ stderrStream,
7192
+ data,
7193
+ 0,
7194
+ data.length,
7195
+ stderrAt
7196
+ );
7197
+ stderrAt += data.length;
7198
+ } catch {
7199
+ cp.stderr.off('data', onStderrData);
7200
+ }
7201
+ };
7202
+ cp.stderr.on('data', onStderrData);
7203
+ detachPipeDataListeners.push(() =>
7204
+ cp.stderr.off('data', onStderrData)
7205
+ );
7186
7206
  }
7187
7207
  try {
7188
7208
  await new Promise((resolve, reject) => {
Binary file
package/jspi/php_8_1.js CHANGED
@@ -7017,7 +7017,11 @@ export function init(RuntimeName, PHPLoader) {
7017
7017
  stdoutParentFd = std[1]?.parent,
7018
7018
  stderrChildFd = std[2]?.child,
7019
7019
  stderrParentFd = std[2]?.parent;
7020
+ const detachPipeDataListeners = [];
7020
7021
  cp.on('exit', function (code) {
7022
+ for (const detach of detachPipeDataListeners) {
7023
+ detach();
7024
+ }
7021
7025
  for (const fd of [stdoutChildFd, stderrChildFd, stdinChildFd]) {
7022
7026
  if (FS.streams[fd] && !FS.isClosed(FS.streams[fd])) {
7023
7027
  FS.close(FS.streams[fd]);
@@ -7029,30 +7033,46 @@ export function init(RuntimeName, PHPLoader) {
7029
7033
  if (stdoutChildFd) {
7030
7034
  const stdoutStream = SYSCALLS.getStreamFromFD(stdoutChildFd);
7031
7035
  let stdoutAt = 0;
7032
- cp.stdout.on('data', function (data) {
7033
- stdoutStream.stream_ops.write(
7034
- stdoutStream,
7035
- data,
7036
- 0,
7037
- data.length,
7038
- stdoutAt
7039
- );
7040
- stdoutAt += data.length;
7041
- });
7036
+ const onStdoutData = function (data) {
7037
+ try {
7038
+ stdoutStream.stream_ops.write(
7039
+ stdoutStream,
7040
+ data,
7041
+ 0,
7042
+ data.length,
7043
+ stdoutAt
7044
+ );
7045
+ stdoutAt += data.length;
7046
+ } catch {
7047
+ cp.stdout.off('data', onStdoutData);
7048
+ }
7049
+ };
7050
+ cp.stdout.on('data', onStdoutData);
7051
+ detachPipeDataListeners.push(() =>
7052
+ cp.stdout.off('data', onStdoutData)
7053
+ );
7042
7054
  }
7043
7055
  if (stderrChildFd) {
7044
7056
  const stderrStream = SYSCALLS.getStreamFromFD(stderrChildFd);
7045
7057
  let stderrAt = 0;
7046
- cp.stderr.on('data', function (data) {
7047
- stderrStream.stream_ops.write(
7048
- stderrStream,
7049
- data,
7050
- 0,
7051
- data.length,
7052
- stderrAt
7053
- );
7054
- stderrAt += data.length;
7055
- });
7058
+ const onStderrData = function (data) {
7059
+ try {
7060
+ stderrStream.stream_ops.write(
7061
+ stderrStream,
7062
+ data,
7063
+ 0,
7064
+ data.length,
7065
+ stderrAt
7066
+ );
7067
+ stderrAt += data.length;
7068
+ } catch {
7069
+ cp.stderr.off('data', onStderrData);
7070
+ }
7071
+ };
7072
+ cp.stderr.on('data', onStderrData);
7073
+ detachPipeDataListeners.push(() =>
7074
+ cp.stderr.off('data', onStderrData)
7075
+ );
7056
7076
  }
7057
7077
  try {
7058
7078
  await new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/web-8-1",
3
- "version": "3.1.19",
3
+ "version": "3.1.21",
4
4
  "description": "PHP 8.1 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": "be542ee28a5966eeb28154cd8e3723db5ff9df07",
38
+ "gitHead": "5864051cbf4c2a55656112d99a3f1b076bcd67cd",
39
39
  "dependencies": {
40
40
  "ini": "4.1.2",
41
41
  "wasm-feature-detect": "1.8.0",
42
- "@php-wasm/universal": "3.1.19"
42
+ "@php-wasm/universal": "3.1.21"
43
43
  },
44
44
  "packageManager": "npm@10.9.2",
45
45
  "overrides": {
@@ -51,6 +51,7 @@
51
51
  "tmp": "0.2.5",
52
52
  "form-data": "^4.0.4",
53
53
  "lodash": "^4.17.23",
54
- "glob": "^9.3.0"
54
+ "glob": "^9.3.0",
55
+ "webpackbar": "^7.0.0"
55
56
  }
56
57
  }