@php-wasm/node 2.0.5 → 2.0.8
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 +41 -36
- package/asyncify/php_7_3.js +41 -36
- package/asyncify/php_7_4.js +41 -36
- package/asyncify/php_8_0.js +41 -36
- package/asyncify/php_8_1.js +41 -36
- package/asyncify/php_8_2.js +41 -36
- package/asyncify/php_8_3.js +50 -45
- package/asyncify/php_8_4.js +46 -41
- package/index.cjs +630 -444
- package/index.js +630 -444
- 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/jspi/7_2_34/php_7_2.wasm
CHANGED
|
Binary file
|
package/jspi/7_3_33/php_7_3.wasm
CHANGED
|
Binary file
|
package/jspi/7_4_33/php_7_4.wasm
CHANGED
|
Binary file
|
package/jspi/8_0_30/php_8_0.wasm
CHANGED
|
Binary file
|
package/jspi/8_1_33/php_8_1.wasm
CHANGED
|
Binary file
|
package/jspi/8_2_29/php_8_2.wasm
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/jspi/php_7_2.js
CHANGED
|
@@ -6994,35 +6994,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6994
6994
|
1: 'exclusive',
|
|
6995
6995
|
2: 'unlocked',
|
|
6996
6996
|
},
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
6997
|
+
is_path_to_shared_fs(path) {
|
|
6998
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
6999
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7000
|
+
if (node.mount.type !== PROXYFS) {
|
|
7001
|
+
return !!node.isSharedFS;
|
|
7002
|
+
}
|
|
7003
|
+
|
|
7004
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7005
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7006
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7007
|
+
if (backingFs) {
|
|
7008
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7009
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7010
|
+
noent_okay: true,
|
|
7011
|
+
});
|
|
7012
|
+
return !!backingNode?.isSharedFS;
|
|
7008
7013
|
}
|
|
7009
7014
|
|
|
7010
|
-
|
|
7011
|
-
if (node.mount.type !== NODEFS) {
|
|
7012
|
-
return false;
|
|
7013
|
-
}
|
|
7014
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7015
|
-
try {
|
|
7016
|
-
const underlyingNode =
|
|
7017
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7018
|
-
return !!underlyingNode?.isSharedFS;
|
|
7019
|
-
} catch (e) {
|
|
7020
|
-
return false;
|
|
7021
|
-
}
|
|
7022
|
-
},
|
|
7023
|
-
is_path_to_shared_fs(path) {
|
|
7024
|
-
const { node } = FS.lookupPath(path);
|
|
7025
|
-
return locking.is_shared_fs_node(node);
|
|
7015
|
+
return false;
|
|
7026
7016
|
},
|
|
7027
7017
|
get_fd_access_mode(fd) {
|
|
7028
7018
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7040,8 +7030,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7040
7030
|
}
|
|
7041
7031
|
},
|
|
7042
7032
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7043
|
-
|
|
7044
|
-
|
|
7033
|
+
// TODO: Should there be a try/catch here?
|
|
7034
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7035
|
+
if (node.mount.type === NODEFS) {
|
|
7036
|
+
return NODEFS.realPath(node);
|
|
7037
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7038
|
+
// TODO: Tolerate ENOENT here?
|
|
7039
|
+
const { node: backingNode, path: backingPath } =
|
|
7040
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7041
|
+
_js_wasm_trace(
|
|
7042
|
+
'backingNode for %s: %s',
|
|
7043
|
+
vfsPath,
|
|
7044
|
+
backingPath,
|
|
7045
|
+
backingNode
|
|
7046
|
+
);
|
|
7047
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7048
|
+
} else {
|
|
7049
|
+
throw new Error(
|
|
7050
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7051
|
+
);
|
|
7052
|
+
}
|
|
7045
7053
|
},
|
|
7046
7054
|
check_lock_params(fd, l_type) {
|
|
7047
7055
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -34409,19 +34417,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34409
34417
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
34410
34418
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
34411
34419
|
// for an FS node, even if wrapped with PROXYFS.
|
|
34412
|
-
const
|
|
34420
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
34413
34421
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
34414
|
-
const node =
|
|
34422
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
34415
34423
|
node.isSharedFS = true;
|
|
34416
34424
|
return node;
|
|
34417
34425
|
};
|
|
34418
34426
|
|
|
34419
34427
|
var originalHashAddNode = FS.hashAddNode;
|
|
34420
34428
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
34421
|
-
if (
|
|
34422
|
-
typeof locking === 'object' &&
|
|
34423
|
-
locking?.is_shared_fs_node(node)
|
|
34424
|
-
) {
|
|
34429
|
+
if (node?.isSharedFS) {
|
|
34425
34430
|
// Avoid caching shared VFS nodes so multiple instances
|
|
34426
34431
|
// can access the same underlying filesystem without
|
|
34427
34432
|
// conflicting caches.
|
package/jspi/php_7_3.js
CHANGED
|
@@ -6994,35 +6994,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6994
6994
|
1: 'exclusive',
|
|
6995
6995
|
2: 'unlocked',
|
|
6996
6996
|
},
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
6997
|
+
is_path_to_shared_fs(path) {
|
|
6998
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
6999
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7000
|
+
if (node.mount.type !== PROXYFS) {
|
|
7001
|
+
return !!node.isSharedFS;
|
|
7002
|
+
}
|
|
7003
|
+
|
|
7004
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7005
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7006
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7007
|
+
if (backingFs) {
|
|
7008
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7009
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7010
|
+
noent_okay: true,
|
|
7011
|
+
});
|
|
7012
|
+
return !!backingNode?.isSharedFS;
|
|
7008
7013
|
}
|
|
7009
7014
|
|
|
7010
|
-
|
|
7011
|
-
if (node.mount.type !== NODEFS) {
|
|
7012
|
-
return false;
|
|
7013
|
-
}
|
|
7014
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7015
|
-
try {
|
|
7016
|
-
const underlyingNode =
|
|
7017
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7018
|
-
return !!underlyingNode?.isSharedFS;
|
|
7019
|
-
} catch (e) {
|
|
7020
|
-
return false;
|
|
7021
|
-
}
|
|
7022
|
-
},
|
|
7023
|
-
is_path_to_shared_fs(path) {
|
|
7024
|
-
const { node } = FS.lookupPath(path);
|
|
7025
|
-
return locking.is_shared_fs_node(node);
|
|
7015
|
+
return false;
|
|
7026
7016
|
},
|
|
7027
7017
|
get_fd_access_mode(fd) {
|
|
7028
7018
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7040,8 +7030,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7040
7030
|
}
|
|
7041
7031
|
},
|
|
7042
7032
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7043
|
-
|
|
7044
|
-
|
|
7033
|
+
// TODO: Should there be a try/catch here?
|
|
7034
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7035
|
+
if (node.mount.type === NODEFS) {
|
|
7036
|
+
return NODEFS.realPath(node);
|
|
7037
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7038
|
+
// TODO: Tolerate ENOENT here?
|
|
7039
|
+
const { node: backingNode, path: backingPath } =
|
|
7040
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7041
|
+
_js_wasm_trace(
|
|
7042
|
+
'backingNode for %s: %s',
|
|
7043
|
+
vfsPath,
|
|
7044
|
+
backingPath,
|
|
7045
|
+
backingNode
|
|
7046
|
+
);
|
|
7047
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7048
|
+
} else {
|
|
7049
|
+
throw new Error(
|
|
7050
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7051
|
+
);
|
|
7052
|
+
}
|
|
7045
7053
|
},
|
|
7046
7054
|
check_lock_params(fd, l_type) {
|
|
7047
7055
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -34409,19 +34417,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34409
34417
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
34410
34418
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
34411
34419
|
// for an FS node, even if wrapped with PROXYFS.
|
|
34412
|
-
const
|
|
34420
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
34413
34421
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
34414
|
-
const node =
|
|
34422
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
34415
34423
|
node.isSharedFS = true;
|
|
34416
34424
|
return node;
|
|
34417
34425
|
};
|
|
34418
34426
|
|
|
34419
34427
|
var originalHashAddNode = FS.hashAddNode;
|
|
34420
34428
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
34421
|
-
if (
|
|
34422
|
-
typeof locking === 'object' &&
|
|
34423
|
-
locking?.is_shared_fs_node(node)
|
|
34424
|
-
) {
|
|
34429
|
+
if (node?.isSharedFS) {
|
|
34425
34430
|
// Avoid caching shared VFS nodes so multiple instances
|
|
34426
34431
|
// can access the same underlying filesystem without
|
|
34427
34432
|
// conflicting caches.
|
package/jspi/php_7_4.js
CHANGED
|
@@ -6994,35 +6994,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6994
6994
|
1: 'exclusive',
|
|
6995
6995
|
2: 'unlocked',
|
|
6996
6996
|
},
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
6997
|
+
is_path_to_shared_fs(path) {
|
|
6998
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
6999
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7000
|
+
if (node.mount.type !== PROXYFS) {
|
|
7001
|
+
return !!node.isSharedFS;
|
|
7002
|
+
}
|
|
7003
|
+
|
|
7004
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7005
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7006
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7007
|
+
if (backingFs) {
|
|
7008
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7009
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7010
|
+
noent_okay: true,
|
|
7011
|
+
});
|
|
7012
|
+
return !!backingNode?.isSharedFS;
|
|
7008
7013
|
}
|
|
7009
7014
|
|
|
7010
|
-
|
|
7011
|
-
if (node.mount.type !== NODEFS) {
|
|
7012
|
-
return false;
|
|
7013
|
-
}
|
|
7014
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7015
|
-
try {
|
|
7016
|
-
const underlyingNode =
|
|
7017
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7018
|
-
return !!underlyingNode?.isSharedFS;
|
|
7019
|
-
} catch (e) {
|
|
7020
|
-
return false;
|
|
7021
|
-
}
|
|
7022
|
-
},
|
|
7023
|
-
is_path_to_shared_fs(path) {
|
|
7024
|
-
const { node } = FS.lookupPath(path);
|
|
7025
|
-
return locking.is_shared_fs_node(node);
|
|
7015
|
+
return false;
|
|
7026
7016
|
},
|
|
7027
7017
|
get_fd_access_mode(fd) {
|
|
7028
7018
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7040,8 +7030,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7040
7030
|
}
|
|
7041
7031
|
},
|
|
7042
7032
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7043
|
-
|
|
7044
|
-
|
|
7033
|
+
// TODO: Should there be a try/catch here?
|
|
7034
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7035
|
+
if (node.mount.type === NODEFS) {
|
|
7036
|
+
return NODEFS.realPath(node);
|
|
7037
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7038
|
+
// TODO: Tolerate ENOENT here?
|
|
7039
|
+
const { node: backingNode, path: backingPath } =
|
|
7040
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7041
|
+
_js_wasm_trace(
|
|
7042
|
+
'backingNode for %s: %s',
|
|
7043
|
+
vfsPath,
|
|
7044
|
+
backingPath,
|
|
7045
|
+
backingNode
|
|
7046
|
+
);
|
|
7047
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7048
|
+
} else {
|
|
7049
|
+
throw new Error(
|
|
7050
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7051
|
+
);
|
|
7052
|
+
}
|
|
7045
7053
|
},
|
|
7046
7054
|
check_lock_params(fd, l_type) {
|
|
7047
7055
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -34409,19 +34417,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34409
34417
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
34410
34418
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
34411
34419
|
// for an FS node, even if wrapped with PROXYFS.
|
|
34412
|
-
const
|
|
34420
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
34413
34421
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
34414
|
-
const node =
|
|
34422
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
34415
34423
|
node.isSharedFS = true;
|
|
34416
34424
|
return node;
|
|
34417
34425
|
};
|
|
34418
34426
|
|
|
34419
34427
|
var originalHashAddNode = FS.hashAddNode;
|
|
34420
34428
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
34421
|
-
if (
|
|
34422
|
-
typeof locking === 'object' &&
|
|
34423
|
-
locking?.is_shared_fs_node(node)
|
|
34424
|
-
) {
|
|
34429
|
+
if (node?.isSharedFS) {
|
|
34425
34430
|
// Avoid caching shared VFS nodes so multiple instances
|
|
34426
34431
|
// can access the same underlying filesystem without
|
|
34427
34432
|
// conflicting caches.
|
package/jspi/php_8_0.js
CHANGED
|
@@ -6994,35 +6994,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6994
6994
|
1: 'exclusive',
|
|
6995
6995
|
2: 'unlocked',
|
|
6996
6996
|
},
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
6997
|
+
is_path_to_shared_fs(path) {
|
|
6998
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
6999
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7000
|
+
if (node.mount.type !== PROXYFS) {
|
|
7001
|
+
return !!node.isSharedFS;
|
|
7002
|
+
}
|
|
7003
|
+
|
|
7004
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7005
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7006
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7007
|
+
if (backingFs) {
|
|
7008
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7009
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7010
|
+
noent_okay: true,
|
|
7011
|
+
});
|
|
7012
|
+
return !!backingNode?.isSharedFS;
|
|
7008
7013
|
}
|
|
7009
7014
|
|
|
7010
|
-
|
|
7011
|
-
if (node.mount.type !== NODEFS) {
|
|
7012
|
-
return false;
|
|
7013
|
-
}
|
|
7014
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7015
|
-
try {
|
|
7016
|
-
const underlyingNode =
|
|
7017
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7018
|
-
return !!underlyingNode?.isSharedFS;
|
|
7019
|
-
} catch (e) {
|
|
7020
|
-
return false;
|
|
7021
|
-
}
|
|
7022
|
-
},
|
|
7023
|
-
is_path_to_shared_fs(path) {
|
|
7024
|
-
const { node } = FS.lookupPath(path);
|
|
7025
|
-
return locking.is_shared_fs_node(node);
|
|
7015
|
+
return false;
|
|
7026
7016
|
},
|
|
7027
7017
|
get_fd_access_mode(fd) {
|
|
7028
7018
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7040,8 +7030,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7040
7030
|
}
|
|
7041
7031
|
},
|
|
7042
7032
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7043
|
-
|
|
7044
|
-
|
|
7033
|
+
// TODO: Should there be a try/catch here?
|
|
7034
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7035
|
+
if (node.mount.type === NODEFS) {
|
|
7036
|
+
return NODEFS.realPath(node);
|
|
7037
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7038
|
+
// TODO: Tolerate ENOENT here?
|
|
7039
|
+
const { node: backingNode, path: backingPath } =
|
|
7040
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7041
|
+
_js_wasm_trace(
|
|
7042
|
+
'backingNode for %s: %s',
|
|
7043
|
+
vfsPath,
|
|
7044
|
+
backingPath,
|
|
7045
|
+
backingNode
|
|
7046
|
+
);
|
|
7047
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7048
|
+
} else {
|
|
7049
|
+
throw new Error(
|
|
7050
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7051
|
+
);
|
|
7052
|
+
}
|
|
7045
7053
|
},
|
|
7046
7054
|
check_lock_params(fd, l_type) {
|
|
7047
7055
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -34409,19 +34417,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34409
34417
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
34410
34418
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
34411
34419
|
// for an FS node, even if wrapped with PROXYFS.
|
|
34412
|
-
const
|
|
34420
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
34413
34421
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
34414
|
-
const node =
|
|
34422
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
34415
34423
|
node.isSharedFS = true;
|
|
34416
34424
|
return node;
|
|
34417
34425
|
};
|
|
34418
34426
|
|
|
34419
34427
|
var originalHashAddNode = FS.hashAddNode;
|
|
34420
34428
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
34421
|
-
if (
|
|
34422
|
-
typeof locking === 'object' &&
|
|
34423
|
-
locking?.is_shared_fs_node(node)
|
|
34424
|
-
) {
|
|
34429
|
+
if (node?.isSharedFS) {
|
|
34425
34430
|
// Avoid caching shared VFS nodes so multiple instances
|
|
34426
34431
|
// can access the same underlying filesystem without
|
|
34427
34432
|
// conflicting caches.
|
package/jspi/php_8_1.js
CHANGED
|
@@ -6994,35 +6994,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6994
6994
|
1: 'exclusive',
|
|
6995
6995
|
2: 'unlocked',
|
|
6996
6996
|
},
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
6997
|
+
is_path_to_shared_fs(path) {
|
|
6998
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
6999
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7000
|
+
if (node.mount.type !== PROXYFS) {
|
|
7001
|
+
return !!node.isSharedFS;
|
|
7002
|
+
}
|
|
7003
|
+
|
|
7004
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7005
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7006
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7007
|
+
if (backingFs) {
|
|
7008
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7009
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7010
|
+
noent_okay: true,
|
|
7011
|
+
});
|
|
7012
|
+
return !!backingNode?.isSharedFS;
|
|
7008
7013
|
}
|
|
7009
7014
|
|
|
7010
|
-
|
|
7011
|
-
if (node.mount.type !== NODEFS) {
|
|
7012
|
-
return false;
|
|
7013
|
-
}
|
|
7014
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7015
|
-
try {
|
|
7016
|
-
const underlyingNode =
|
|
7017
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7018
|
-
return !!underlyingNode?.isSharedFS;
|
|
7019
|
-
} catch (e) {
|
|
7020
|
-
return false;
|
|
7021
|
-
}
|
|
7022
|
-
},
|
|
7023
|
-
is_path_to_shared_fs(path) {
|
|
7024
|
-
const { node } = FS.lookupPath(path);
|
|
7025
|
-
return locking.is_shared_fs_node(node);
|
|
7015
|
+
return false;
|
|
7026
7016
|
},
|
|
7027
7017
|
get_fd_access_mode(fd) {
|
|
7028
7018
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7040,8 +7030,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7040
7030
|
}
|
|
7041
7031
|
},
|
|
7042
7032
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7043
|
-
|
|
7044
|
-
|
|
7033
|
+
// TODO: Should there be a try/catch here?
|
|
7034
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7035
|
+
if (node.mount.type === NODEFS) {
|
|
7036
|
+
return NODEFS.realPath(node);
|
|
7037
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7038
|
+
// TODO: Tolerate ENOENT here?
|
|
7039
|
+
const { node: backingNode, path: backingPath } =
|
|
7040
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7041
|
+
_js_wasm_trace(
|
|
7042
|
+
'backingNode for %s: %s',
|
|
7043
|
+
vfsPath,
|
|
7044
|
+
backingPath,
|
|
7045
|
+
backingNode
|
|
7046
|
+
);
|
|
7047
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7048
|
+
} else {
|
|
7049
|
+
throw new Error(
|
|
7050
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7051
|
+
);
|
|
7052
|
+
}
|
|
7045
7053
|
},
|
|
7046
7054
|
check_lock_params(fd, l_type) {
|
|
7047
7055
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -34409,19 +34417,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34409
34417
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
34410
34418
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
34411
34419
|
// for an FS node, even if wrapped with PROXYFS.
|
|
34412
|
-
const
|
|
34420
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
34413
34421
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
34414
|
-
const node =
|
|
34422
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
34415
34423
|
node.isSharedFS = true;
|
|
34416
34424
|
return node;
|
|
34417
34425
|
};
|
|
34418
34426
|
|
|
34419
34427
|
var originalHashAddNode = FS.hashAddNode;
|
|
34420
34428
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
34421
|
-
if (
|
|
34422
|
-
typeof locking === 'object' &&
|
|
34423
|
-
locking?.is_shared_fs_node(node)
|
|
34424
|
-
) {
|
|
34429
|
+
if (node?.isSharedFS) {
|
|
34425
34430
|
// Avoid caching shared VFS nodes so multiple instances
|
|
34426
34431
|
// can access the same underlying filesystem without
|
|
34427
34432
|
// conflicting caches.
|
package/jspi/php_8_2.js
CHANGED
|
@@ -6994,35 +6994,25 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6994
6994
|
1: 'exclusive',
|
|
6995
6995
|
2: 'unlocked',
|
|
6996
6996
|
},
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
6997
|
+
is_path_to_shared_fs(path) {
|
|
6998
|
+
_js_wasm_trace('is_path_to_shared_fs(%s)', path);
|
|
6999
|
+
const { node } = FS.lookupPath(path, { noent_okay: true });
|
|
7000
|
+
if (node.mount.type !== PROXYFS) {
|
|
7001
|
+
return !!node.isSharedFS;
|
|
7002
|
+
}
|
|
7003
|
+
|
|
7004
|
+
// This looks like a PROXYFS node. Let's try a lookup.
|
|
7005
|
+
const nodePath = PROXYFS.realPath(node);
|
|
7006
|
+
const backingFs = node?.mount?.opts?.fs;
|
|
7007
|
+
if (backingFs) {
|
|
7008
|
+
// Tolerate ENOENT because looking up a MEMFS node by path always fails.
|
|
7009
|
+
const { node: backingNode } = backingFs.lookupPath(nodePath, {
|
|
7010
|
+
noent_okay: true,
|
|
7011
|
+
});
|
|
7012
|
+
return !!backingNode?.isSharedFS;
|
|
7008
7013
|
}
|
|
7009
7014
|
|
|
7010
|
-
|
|
7011
|
-
if (node.mount.type !== NODEFS) {
|
|
7012
|
-
return false;
|
|
7013
|
-
}
|
|
7014
|
-
const vfsPath = node.mount.type.realPath(node);
|
|
7015
|
-
try {
|
|
7016
|
-
const underlyingNode =
|
|
7017
|
-
node.mount.opts.fs.lookupPath(vfsPath)?.node;
|
|
7018
|
-
return !!underlyingNode?.isSharedFS;
|
|
7019
|
-
} catch (e) {
|
|
7020
|
-
return false;
|
|
7021
|
-
}
|
|
7022
|
-
},
|
|
7023
|
-
is_path_to_shared_fs(path) {
|
|
7024
|
-
const { node } = FS.lookupPath(path);
|
|
7025
|
-
return locking.is_shared_fs_node(node);
|
|
7015
|
+
return false;
|
|
7026
7016
|
},
|
|
7027
7017
|
get_fd_access_mode(fd) {
|
|
7028
7018
|
const emscripten_F_GETFL = Number('3');
|
|
@@ -7040,8 +7030,26 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7040
7030
|
}
|
|
7041
7031
|
},
|
|
7042
7032
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7043
|
-
|
|
7044
|
-
|
|
7033
|
+
// TODO: Should there be a try/catch here?
|
|
7034
|
+
const { node } = FS.lookupPath(vfsPath, {});
|
|
7035
|
+
if (node.mount.type === NODEFS) {
|
|
7036
|
+
return NODEFS.realPath(node);
|
|
7037
|
+
} else if (node.mount.type === PROXYFS) {
|
|
7038
|
+
// TODO: Tolerate ENOENT here?
|
|
7039
|
+
const { node: backingNode, path: backingPath } =
|
|
7040
|
+
node.mount.opts.fs.lookupPath(vfsPath);
|
|
7041
|
+
_js_wasm_trace(
|
|
7042
|
+
'backingNode for %s: %s',
|
|
7043
|
+
vfsPath,
|
|
7044
|
+
backingPath,
|
|
7045
|
+
backingNode
|
|
7046
|
+
);
|
|
7047
|
+
return backingNode.mount.type.realPath(backingNode);
|
|
7048
|
+
} else {
|
|
7049
|
+
throw new Error(
|
|
7050
|
+
`Unsupported filesystem type for path ${vfsPath}`
|
|
7051
|
+
);
|
|
7052
|
+
}
|
|
7045
7053
|
},
|
|
7046
7054
|
check_lock_params(fd, l_type) {
|
|
7047
7055
|
const emscripten_O_RDONLY = Number('0');
|
|
@@ -34409,19 +34417,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34409
34417
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
34410
34418
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
34411
34419
|
// for an FS node, even if wrapped with PROXYFS.
|
|
34412
|
-
const
|
|
34420
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
34413
34421
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
34414
|
-
const node =
|
|
34422
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
34415
34423
|
node.isSharedFS = true;
|
|
34416
34424
|
return node;
|
|
34417
34425
|
};
|
|
34418
34426
|
|
|
34419
34427
|
var originalHashAddNode = FS.hashAddNode;
|
|
34420
34428
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
34421
|
-
if (
|
|
34422
|
-
typeof locking === 'object' &&
|
|
34423
|
-
locking?.is_shared_fs_node(node)
|
|
34424
|
-
) {
|
|
34429
|
+
if (node?.isSharedFS) {
|
|
34425
34430
|
// Avoid caching shared VFS nodes so multiple instances
|
|
34426
34431
|
// can access the same underlying filesystem without
|
|
34427
34432
|
// conflicting caches.
|