@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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/asyncify/php_7_2.js
CHANGED
|
@@ -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');
|
|
@@ -35622,19 +35630,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35622
35630
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
35623
35631
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
35624
35632
|
// for an FS node, even if wrapped with PROXYFS.
|
|
35625
|
-
const
|
|
35633
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
35626
35634
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
35627
|
-
const node =
|
|
35635
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
35628
35636
|
node.isSharedFS = true;
|
|
35629
35637
|
return node;
|
|
35630
35638
|
};
|
|
35631
35639
|
|
|
35632
35640
|
var originalHashAddNode = FS.hashAddNode;
|
|
35633
35641
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
35634
|
-
if (
|
|
35635
|
-
typeof locking === 'object' &&
|
|
35636
|
-
locking?.is_shared_fs_node(node)
|
|
35637
|
-
) {
|
|
35642
|
+
if (node?.isSharedFS) {
|
|
35638
35643
|
// Avoid caching shared VFS nodes so multiple instances
|
|
35639
35644
|
// can access the same underlying filesystem without
|
|
35640
35645
|
// conflicting caches.
|
package/asyncify/php_7_3.js
CHANGED
|
@@ -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');
|
|
@@ -35636,19 +35644,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35636
35644
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
35637
35645
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
35638
35646
|
// for an FS node, even if wrapped with PROXYFS.
|
|
35639
|
-
const
|
|
35647
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
35640
35648
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
35641
|
-
const node =
|
|
35649
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
35642
35650
|
node.isSharedFS = true;
|
|
35643
35651
|
return node;
|
|
35644
35652
|
};
|
|
35645
35653
|
|
|
35646
35654
|
var originalHashAddNode = FS.hashAddNode;
|
|
35647
35655
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
35648
|
-
if (
|
|
35649
|
-
typeof locking === 'object' &&
|
|
35650
|
-
locking?.is_shared_fs_node(node)
|
|
35651
|
-
) {
|
|
35656
|
+
if (node?.isSharedFS) {
|
|
35652
35657
|
// Avoid caching shared VFS nodes so multiple instances
|
|
35653
35658
|
// can access the same underlying filesystem without
|
|
35654
35659
|
// conflicting caches.
|
package/asyncify/php_7_4.js
CHANGED
|
@@ -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');
|
|
@@ -35649,19 +35657,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35649
35657
|
// We override NODEFS.createNode() to add an `isSharedFS` flag to all NODEFS
|
|
35650
35658
|
// nodes. This way we can tell whether file-locking is needed and possible
|
|
35651
35659
|
// for an FS node, even if wrapped with PROXYFS.
|
|
35652
|
-
const
|
|
35660
|
+
const originalNodeFsCreateNode = NODEFS.createNode;
|
|
35653
35661
|
NODEFS.createNode = function createNodeWithSharedFlag() {
|
|
35654
|
-
const node =
|
|
35662
|
+
const node = originalNodeFsCreateNode.apply(NODEFS, arguments);
|
|
35655
35663
|
node.isSharedFS = true;
|
|
35656
35664
|
return node;
|
|
35657
35665
|
};
|
|
35658
35666
|
|
|
35659
35667
|
var originalHashAddNode = FS.hashAddNode;
|
|
35660
35668
|
FS.hashAddNode = function hashAddNodeIfNotSharedFS(node) {
|
|
35661
|
-
if (
|
|
35662
|
-
typeof locking === 'object' &&
|
|
35663
|
-
locking?.is_shared_fs_node(node)
|
|
35664
|
-
) {
|
|
35669
|
+
if (node?.isSharedFS) {
|
|
35665
35670
|
// Avoid caching shared VFS nodes so multiple instances
|
|
35666
35671
|
// can access the same underlying filesystem without
|
|
35667
35672
|
// conflicting caches.
|
package/asyncify/php_8_0.js
CHANGED
|
@@ -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');
|
|
@@ -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.
|
package/asyncify/php_8_1.js
CHANGED
|
@@ -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');
|
|
@@ -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_2.js
CHANGED
|
@@ -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');
|
|
@@ -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.
|