@php-wasm/node 2.0.5 → 2.0.7
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/asyncify/7_2_34/php_7_2.wasm +0 -0
- package/asyncify/7_3_33/php_7_3.wasm +0 -0
- package/asyncify/7_4_33/php_7_4.wasm +0 -0
- package/asyncify/8_0_30/php_8_0.wasm +0 -0
- package/asyncify/8_1_33/php_8_1.wasm +0 -0
- package/asyncify/8_2_29/php_8_2.wasm +0 -0
- package/asyncify/8_3_24/php_8_3.wasm +0 -0
- package/asyncify/8_4_11/php_8_4.wasm +0 -0
- package/asyncify/php_7_2.js +40 -35
- package/asyncify/php_7_3.js +40 -35
- package/asyncify/php_7_4.js +40 -35
- package/asyncify/php_8_0.js +40 -35
- package/asyncify/php_8_1.js +40 -35
- package/asyncify/php_8_2.js +40 -35
- package/asyncify/php_8_3.js +50 -45
- package/asyncify/php_8_4.js +46 -41
- package/index.cjs +623 -437
- package/index.js +623 -437
- package/jspi/7_2_34/php_7_2.wasm +0 -0
- package/jspi/7_3_33/php_7_3.wasm +0 -0
- package/jspi/7_4_33/php_7_4.wasm +0 -0
- package/jspi/8_0_30/php_8_0.wasm +0 -0
- package/jspi/8_1_33/php_8_1.wasm +0 -0
- package/jspi/8_2_29/php_8_2.wasm +0 -0
- package/jspi/8_3_24/php_8_3.wasm +0 -0
- package/jspi/8_4_11/php_8_4.wasm +0 -0
- package/jspi/php_7_2.js +40 -35
- package/jspi/php_7_3.js +40 -35
- package/jspi/php_7_4.js +40 -35
- package/jspi/php_8_0.js +40 -35
- package/jspi/php_8_1.js +40 -35
- package/jspi/php_8_2.js +40 -35
- package/jspi/php_8_3.js +46 -41
- package/jspi/php_8_4.js +46 -41
- package/lib/file-lock-manager-for-node.d.ts +9 -2
- package/lib/load-runtime.d.ts +2 -1
- package/package.json +7 -7
package/asyncify/php_8_3.js
CHANGED
|
@@ -6,10 +6,10 @@ const require = createRequire(import.meta.url);
|
|
|
6
6
|
// Note: The path module is currently needed by code injected by the php-wasm Dockerfile.
|
|
7
7
|
import path from 'path';
|
|
8
8
|
|
|
9
|
-
const dependencyFilename = path.join(__dirname, '
|
|
9
|
+
const dependencyFilename = path.join(__dirname, '8_3_24', 'php_8_3.wasm');
|
|
10
10
|
export { dependencyFilename };
|
|
11
|
-
export const dependenciesTotalSize =
|
|
12
|
-
const phpVersionString = '8.3.
|
|
11
|
+
export const dependenciesTotalSize = 33144925;
|
|
12
|
+
const phpVersionString = '8.3.24';
|
|
13
13
|
export function init(RuntimeName, PHPLoader) {
|
|
14
14
|
// The rest of the code comes from the built php.js file and esm-suffix.js
|
|
15
15
|
// include: shell.js
|
|
@@ -831,7 +831,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
831
831
|
},
|
|
832
832
|
};
|
|
833
833
|
|
|
834
|
-
var ___heap_base =
|
|
834
|
+
var ___heap_base = 15213248;
|
|
835
835
|
|
|
836
836
|
var alignMemory = (size, alignment) => {
|
|
837
837
|
return Math.ceil(size / alignment) * alignment;
|
|
@@ -995,7 +995,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
995
995
|
|
|
996
996
|
/** @type {WebAssembly.Table} */
|
|
997
997
|
var wasmTable = new WebAssembly.Table({
|
|
998
|
-
initial:
|
|
998
|
+
initial: 16131,
|
|
999
999
|
element: 'anyfunc',
|
|
1000
1000
|
});
|
|
1001
1001
|
var getWasmTableEntry = (funcPtr) => {
|
|
@@ -1856,13 +1856,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
1856
1856
|
1024
|
|
1857
1857
|
);
|
|
1858
1858
|
|
|
1859
|
-
var ___stack_high =
|
|
1859
|
+
var ___stack_high = 15213248;
|
|
1860
1860
|
|
|
1861
|
-
var ___stack_low =
|
|
1861
|
+
var ___stack_low = 14164672;
|
|
1862
1862
|
|
|
1863
1863
|
var ___stack_pointer = new WebAssembly.Global(
|
|
1864
1864
|
{ value: 'i32', mutable: true },
|
|
1865
|
-
|
|
1865
|
+
15213248
|
|
1866
1866
|
);
|
|
1867
1867
|
|
|
1868
1868
|
var PATH = {
|
|
@@ -7103,35 +7103,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7103
7103
|
1: 'exclusive',
|
|
7104
7104
|
2: 'unlocked',
|
|
7105
7105
|
},
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7106
|
+
is_path_to_shared_fs(path) {
|
|
7107
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
7108
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7109
|
+
if (node.mount.type !== PROXYFS) {
|
|
7110
|
+
return !!node.isSharedFS;
|
|
7111
|
+
}
|
|
7112
|
+
|
|
7113
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7114
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7115
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7116
|
+
if (backingFs) {
|
|
7117
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7118
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7119
|
+
noent_okay: true,
|
|
7120
|
+
});
|
|
7121
|
+
return !!backingNode?.isSharedFS;
|
|
7117
7122
|
}
|
|
7118
7123
|
|
|
7119
|
-
|
|
7120
|
-
if (node.mount.type !== NODEFS) {
|
|
7121
|
-
return false;
|
|
7122
|
-
}
|
|
7123
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7124
|
-
try {
|
|
7125
|
-
const underlyingNode =
|
|
7126
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7127
|
-
return !!underlyingNode?.isSharedFS;
|
|
7128
|
-
} catch (e) {
|
|
7129
|
-
return false;
|
|
7130
|
-
}
|
|
7131
|
-
},
|
|
7132
|
-
is_path_to_shared_fs(path) {
|
|
7133
|
-
const { node } = FS.lookupPath(path);
|
|
7134
|
-
return locking.is_shared_fs_node(node);
|
|
7124
|
+
return false;
|
|
7135
7125
|
},
|
|
7136
7126
|
get_fd_access_mode(fd) {
|
|
7137
7127
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7149,8 +7139,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7149
7139
|
}
|
|
7150
7140
|
},
|
|
7151
7141
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7152
|
-
|
|
7153
|
-
|
|
7142
|
+
// TODO: Should there be a try/catch here?
|
|
7143
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7144
|
+
if (node.mount.type === NODEFS) {
|
|
7145
|
+
return NODEFS.realPath(node);
|
|
7146
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7147
|
+
// TODO: Tolerate ENOENT here?
|
|
7148
|
+
const { node: backingNode, path: backingPath } =
|
|
7149
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7150
|
+
_js_wasm_trace(
|
|
7151
|
+
'backingNode for %s: %s',
|
|
7152
|
+
vfsPath,
|
|
7153
|
+
backingPath,
|
|
7154
|
+
backingNode
|
|
7155
|
+
);
|
|
7156
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7157
|
+
} else {
|
|
7158
|
+
throw new Error(
|
|
7159
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7160
|
+
);
|
|
7161
|
+
}
|
|
7154
7162
|
},
|
|
7155
7163
|
check_lock_params(fd, l_type) {
|
|
7156
7164
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -32092,13 +32100,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
32092
32100
|
// End JS library code
|
|
32093
32101
|
|
|
32094
32102
|
var ASM_CONSTS = {
|
|
32095
|
-
|
|
32103
|
+
13231949: ($0) => {
|
|
32096
32104
|
if (!$0) {
|
|
32097
32105
|
AL.alcErr = 0xa004;
|
|
32098
32106
|
return 1;
|
|
32099
32107
|
}
|
|
32100
32108
|
},
|
|
32101
|
-
|
|
32109
|
+
13231997: ($0) => {
|
|
32102
32110
|
if (!AL.currentCtx) {
|
|
32103
32111
|
err('alGetProcAddress() called without a valid context');
|
|
32104
32112
|
return 1;
|
|
@@ -35675,19 +35683,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35675
35683
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
35676
35684
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
35677
35685
|
// for an FS node, even if wrapped with PROXYFS.
|
|
35678
|
-
const
|
|
35686
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
35679
35687
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
35680
|
-
const node =
|
|
35688
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
35681
35689
|
node.isSharedFS = true;
|
|
35682
35690
|
return node;
|
|
35683
35691
|
};
|
|
35684
35692
|
|
|
35685
35693
|
var originalHashAddNode = FS.hashAddNode;
|
|
35686
35694
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
35687
|
-
if (
|
|
35688
|
-
typeof locking === 'object' &&
|
|
35689
|
-
locking?.is_shared_fs_node(node)
|
|
35690
|
-
) {
|
|
35695
|
+
if (node?.isSharedFS) {
|
|
35691
35696
|
// Avoid caching shared VFS nodes so multiple instances
|
|
35692
35697
|
// can access the same underlying filesystem without
|
|
35693
35698
|
// conflicting caches.
|
package/asyncify/php_8_4.js
CHANGED
|
@@ -6,10 +6,10 @@ const require = createRequire(import.meta.url);
|
|
|
6
6
|
// Note: The path module is currently needed by code injected by the php-wasm Dockerfile.
|
|
7
7
|
import path from 'path';
|
|
8
8
|
|
|
9
|
-
const dependencyFilename = path.join(__dirname, '
|
|
9
|
+
const dependencyFilename = path.join(__dirname, '8_4_11', 'php_8_4.wasm');
|
|
10
10
|
export { dependencyFilename };
|
|
11
|
-
export const dependenciesTotalSize =
|
|
12
|
-
const phpVersionString = '8.4.
|
|
11
|
+
export const dependenciesTotalSize = 36942530;
|
|
12
|
+
const phpVersionString = '8.4.11';
|
|
13
13
|
export function init(RuntimeName, PHPLoader) {
|
|
14
14
|
// The rest of the code comes from the built php.js file and esm-suffix.js
|
|
15
15
|
// include: shell.js
|
|
@@ -995,7 +995,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
995
995
|
|
|
996
996
|
/** @type {WebAssembly.Table} */
|
|
997
997
|
var wasmTable = new WebAssembly.Table({
|
|
998
|
-
initial:
|
|
998
|
+
initial: 16955,
|
|
999
999
|
element: 'anyfunc',
|
|
1000
1000
|
});
|
|
1001
1001
|
var getWasmTableEntry = (funcPtr) => {
|
|
@@ -7103,35 +7103,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7103
7103
|
1: 'exclusive',
|
|
7104
7104
|
2: 'unlocked',
|
|
7105
7105
|
},
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7106
|
+
is_path_to_shared_fs(path) {
|
|
7107
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
7108
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7109
|
+
if (node.mount.type !== PROXYFS) {
|
|
7110
|
+
return !!node.isSharedFS;
|
|
7111
|
+
}
|
|
7112
|
+
|
|
7113
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7114
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7115
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7116
|
+
if (backingFs) {
|
|
7117
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7118
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7119
|
+
noent_okay: true,
|
|
7120
|
+
});
|
|
7121
|
+
return !!backingNode?.isSharedFS;
|
|
7117
7122
|
}
|
|
7118
7123
|
|
|
7119
|
-
|
|
7120
|
-
if (node.mount.type !== NODEFS) {
|
|
7121
|
-
return false;
|
|
7122
|
-
}
|
|
7123
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7124
|
-
try {
|
|
7125
|
-
const underlyingNode =
|
|
7126
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7127
|
-
return !!underlyingNode?.isSharedFS;
|
|
7128
|
-
} catch (e) {
|
|
7129
|
-
return false;
|
|
7130
|
-
}
|
|
7131
|
-
},
|
|
7132
|
-
is_path_to_shared_fs(path) {
|
|
7133
|
-
const { node } = FS.lookupPath(path);
|
|
7134
|
-
return locking.is_shared_fs_node(node);
|
|
7124
|
+
return false;
|
|
7135
7125
|
},
|
|
7136
7126
|
get_fd_access_mode(fd) {
|
|
7137
7127
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7149,8 +7139,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7149
7139
|
}
|
|
7150
7140
|
},
|
|
7151
7141
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7152
|
-
|
|
7153
|
-
|
|
7142
|
+
// TODO: Should there be a try/catch here?
|
|
7143
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7144
|
+
if (node.mount.type === NODEFS) {
|
|
7145
|
+
return NODEFS.realPath(node);
|
|
7146
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7147
|
+
// TODO: Tolerate ENOENT here?
|
|
7148
|
+
const { node: backingNode, path: backingPath } =
|
|
7149
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7150
|
+
_js_wasm_trace(
|
|
7151
|
+
'backingNode for %s: %s',
|
|
7152
|
+
vfsPath,
|
|
7153
|
+
backingPath,
|
|
7154
|
+
backingNode
|
|
7155
|
+
);
|
|
7156
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7157
|
+
} else {
|
|
7158
|
+
throw new Error(
|
|
7159
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7160
|
+
);
|
|
7161
|
+
}
|
|
7154
7162
|
},
|
|
7155
7163
|
check_lock_params(fd, l_type) {
|
|
7156
7164
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -32092,13 +32100,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
32092
32100
|
// End JS library code
|
|
32093
32101
|
|
|
32094
32102
|
var ASM_CONSTS = {
|
|
32095
|
-
|
|
32103
|
+
16327421: ($0) => {
|
|
32096
32104
|
if (!$0) {
|
|
32097
32105
|
AL.alcErr = 0xa004;
|
|
32098
32106
|
return 1;
|
|
32099
32107
|
}
|
|
32100
32108
|
},
|
|
32101
|
-
|
|
32109
|
+
16327469: ($0) => {
|
|
32102
32110
|
if (!AL.currentCtx) {
|
|
32103
32111
|
err('alGetProcAddress() called without a valid context');
|
|
32104
32112
|
return 1;
|
|
@@ -35662,19 +35670,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35662
35670
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
35663
35671
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
35664
35672
|
// for an FS node, even if wrapped with PROXYFS.
|
|
35665
|
-
const
|
|
35673
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
35666
35674
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
35667
|
-
const node =
|
|
35675
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
35668
35676
|
node.isSharedFS = true;
|
|
35669
35677
|
return node;
|
|
35670
35678
|
};
|
|
35671
35679
|
|
|
35672
35680
|
var originalHashAddNode = FS.hashAddNode;
|
|
35673
35681
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
35674
|
-
if (
|
|
35675
|
-
typeof locking === 'object' &&
|
|
35676
|
-
locking?.is_shared_fs_node(node)
|
|
35677
|
-
) {
|
|
35682
|
+
if (node?.isSharedFS) {
|
|
35678
35683
|
// Avoid caching shared VFS nodes so multiple instances
|
|
35679
35684
|
// can access the same underlying filesystem without
|
|
35680
35685
|
// conflicting caches.
|