@php-wasm/node
Advanced tools
+32
-29
@@ -485,2 +485,3 @@ "use strict"; | ||
| var import_fs2 = __toESM(require("fs"), 1); | ||
| var import_path = __toESM(require("path"), 1); | ||
@@ -514,2 +515,3 @@ // packages/php-wasm/node/src/lib/extensions/intl/get-intl-extension-module.ts | ||
| // packages/php-wasm/node/src/lib/extensions/intl/with-intl.ts | ||
| var import_meta = {}; | ||
| async function withIntl(version = import_universal5.LatestSupportedPHPVersion, options) { | ||
@@ -520,3 +522,4 @@ const extensionName = "intl.so"; | ||
| const dataName = "icu.dat"; | ||
| const dataPath = `${__dirname}/shared/${dataName}`; | ||
| const moduleDir = typeof __dirname !== "undefined" ? __dirname : import_meta.dirname; | ||
| const dataPath = import_path.default.join(moduleDir, "shared", dataName); | ||
| const ICUData = import_fs2.default.readFileSync(dataPath); | ||
@@ -576,3 +579,3 @@ return { | ||
| var import_util = require("@php-wasm/util"); | ||
| var import_path = require("path"); | ||
| var import_path2 = require("path"); | ||
| async function loadNodeRuntime(phpVersion, options = {}) { | ||
@@ -611,3 +614,3 @@ let emscriptenOptions = { | ||
| phpRuntime.FS.mkdirTree( | ||
| (0, import_path.dirname)(symlinkMountPath) | ||
| (0, import_path2.dirname)(symlinkMountPath) | ||
| ); | ||
@@ -665,3 +668,3 @@ phpRuntime.FS.writeFile(symlinkMountPath, ""); | ||
| var import_fs4 = require("fs"); | ||
| var import_path2 = require("path"); | ||
| var import_path3 = require("path"); | ||
| function createNodeFsMountHandler(localPath) { | ||
@@ -673,3 +676,3 @@ return function(php, FS, vfsMountPoint) { | ||
| if (lstat.isFile() || lstat.isSymbolicLink()) { | ||
| FS.mkdirTree((0, import_path2.dirname)(vfsMountPoint)); | ||
| FS.mkdirTree((0, import_path3.dirname)(vfsMountPoint)); | ||
| FS.writeFile(vfsMountPoint, ""); | ||
@@ -733,11 +736,11 @@ } else if (lstat.isDirectory()) { | ||
| } | ||
| function statPathFollowSymlinks(path) { | ||
| let stat = (0, import_node_fs.lstatSync)(path); | ||
| function statPathFollowSymlinks(path2) { | ||
| let stat = (0, import_node_fs.lstatSync)(path2); | ||
| if (stat.isSymbolicLink()) { | ||
| const fs4 = require("fs"); | ||
| let target = path; | ||
| let target = path2; | ||
| const seen = /* @__PURE__ */ new Set(); | ||
| while (true) { | ||
| if (seen.has(target)) { | ||
| throw new Error(`Symlink loop detected: ${path}`); | ||
| throw new Error(`Symlink loop detected: ${path2}`); | ||
| } | ||
@@ -780,4 +783,4 @@ seen.add(target); | ||
| */ | ||
| lockWholeFile(path, op) { | ||
| if (this.locks.get(path) === void 0) { | ||
| lockWholeFile(path2, op) { | ||
| if (this.locks.get(path2) === void 0) { | ||
| if (op.type === "unlock") { | ||
@@ -787,3 +790,3 @@ return true; | ||
| const maybeLock = FileLock.maybeCreate( | ||
| path, | ||
| path2, | ||
| op.type, | ||
@@ -795,7 +798,7 @@ this.nativeFlockSync | ||
| } | ||
| this.locks.set(path, maybeLock); | ||
| this.locks.set(path2, maybeLock); | ||
| } | ||
| const lock = this.locks.get(path); | ||
| const lock = this.locks.get(path2); | ||
| const result = lock.lockWholeFile(op); | ||
| this.forgetPathIfUnlocked(path); | ||
| this.forgetPathIfUnlocked(path2); | ||
| return result; | ||
@@ -811,4 +814,4 @@ } | ||
| */ | ||
| lockFileByteRange(path, requestedLock) { | ||
| if (!this.locks.has(path)) { | ||
| lockFileByteRange(path2, requestedLock) { | ||
| if (!this.locks.has(path2)) { | ||
| if (requestedLock.type === "unlocked") { | ||
@@ -818,3 +821,3 @@ return true; | ||
| const maybeLock = FileLock.maybeCreate( | ||
| path, | ||
| path2, | ||
| requestedLock.type, | ||
@@ -826,5 +829,5 @@ this.nativeFlockSync | ||
| } | ||
| this.locks.set(path, maybeLock); | ||
| this.locks.set(path2, maybeLock); | ||
| } | ||
| const lock = this.locks.get(path); | ||
| const lock = this.locks.get(path2); | ||
| return lock.lockFileByteRange(requestedLock); | ||
@@ -839,4 +842,4 @@ } | ||
| */ | ||
| findFirstConflictingByteRangeLock(path, desiredLock) { | ||
| const lock = this.locks.get(path); | ||
| findFirstConflictingByteRangeLock(path2, desiredLock) { | ||
| const lock = this.locks.get(path2); | ||
| if (lock === void 0) { | ||
@@ -853,5 +856,5 @@ return void 0; | ||
| releaseLocksForProcess(pid) { | ||
| for (const [path, lock] of this.locks.entries()) { | ||
| for (const [path2, lock] of this.locks.entries()) { | ||
| lock.releaseLocksForProcess(pid); | ||
| this.forgetPathIfUnlocked(path); | ||
| this.forgetPathIfUnlocked(path2); | ||
| } | ||
@@ -879,4 +882,4 @@ } | ||
| */ | ||
| forgetPathIfUnlocked(path) { | ||
| const lock = this.locks.get(path); | ||
| forgetPathIfUnlocked(path2) { | ||
| const lock = this.locks.get(path2); | ||
| if (!lock) { | ||
@@ -887,3 +890,3 @@ return; | ||
| lock.dispose(); | ||
| this.locks.delete(path); | ||
| this.locks.delete(path2); | ||
| } | ||
@@ -901,6 +904,6 @@ } | ||
| */ | ||
| static maybeCreate(path, mode, nativeFlockSync) { | ||
| static maybeCreate(path2, mode, nativeFlockSync) { | ||
| let fd; | ||
| try { | ||
| fd = (0, import_fs5.openSync)(path, "a+"); | ||
| fd = (0, import_fs5.openSync)(path2, "a+"); | ||
| const flockFlags = mode === "exclusive" ? "exnb" : "shnb"; | ||
@@ -907,0 +910,0 @@ nativeFlockSync(fd, flockFlags); |
+27
-25
@@ -452,2 +452,3 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { | ||
| import fs2 from "fs"; | ||
| import path from "path"; | ||
@@ -486,3 +487,4 @@ // packages/php-wasm/node/src/lib/extensions/intl/get-intl-extension-module.ts | ||
| const dataName = "icu.dat"; | ||
| const dataPath = `${__dirname}/shared/${dataName}`; | ||
| const moduleDir = typeof __dirname !== "undefined" ? __dirname : import.meta.dirname; | ||
| const dataPath = path.join(moduleDir, "shared", dataName); | ||
| const ICUData = fs2.readFileSync(dataPath); | ||
@@ -697,11 +699,11 @@ return { | ||
| } | ||
| function statPathFollowSymlinks(path) { | ||
| let stat = lstatSync2(path); | ||
| function statPathFollowSymlinks(path2) { | ||
| let stat = lstatSync2(path2); | ||
| if (stat.isSymbolicLink()) { | ||
| const fs4 = __require("fs"); | ||
| let target = path; | ||
| let target = path2; | ||
| const seen = /* @__PURE__ */ new Set(); | ||
| while (true) { | ||
| if (seen.has(target)) { | ||
| throw new Error(`Symlink loop detected: ${path}`); | ||
| throw new Error(`Symlink loop detected: ${path2}`); | ||
| } | ||
@@ -744,4 +746,4 @@ seen.add(target); | ||
| */ | ||
| lockWholeFile(path, op) { | ||
| if (this.locks.get(path) === void 0) { | ||
| lockWholeFile(path2, op) { | ||
| if (this.locks.get(path2) === void 0) { | ||
| if (op.type === "unlock") { | ||
@@ -751,3 +753,3 @@ return true; | ||
| const maybeLock = FileLock.maybeCreate( | ||
| path, | ||
| path2, | ||
| op.type, | ||
@@ -759,7 +761,7 @@ this.nativeFlockSync | ||
| } | ||
| this.locks.set(path, maybeLock); | ||
| this.locks.set(path2, maybeLock); | ||
| } | ||
| const lock = this.locks.get(path); | ||
| const lock = this.locks.get(path2); | ||
| const result = lock.lockWholeFile(op); | ||
| this.forgetPathIfUnlocked(path); | ||
| this.forgetPathIfUnlocked(path2); | ||
| return result; | ||
@@ -775,4 +777,4 @@ } | ||
| */ | ||
| lockFileByteRange(path, requestedLock) { | ||
| if (!this.locks.has(path)) { | ||
| lockFileByteRange(path2, requestedLock) { | ||
| if (!this.locks.has(path2)) { | ||
| if (requestedLock.type === "unlocked") { | ||
@@ -782,3 +784,3 @@ return true; | ||
| const maybeLock = FileLock.maybeCreate( | ||
| path, | ||
| path2, | ||
| requestedLock.type, | ||
@@ -790,5 +792,5 @@ this.nativeFlockSync | ||
| } | ||
| this.locks.set(path, maybeLock); | ||
| this.locks.set(path2, maybeLock); | ||
| } | ||
| const lock = this.locks.get(path); | ||
| const lock = this.locks.get(path2); | ||
| return lock.lockFileByteRange(requestedLock); | ||
@@ -803,4 +805,4 @@ } | ||
| */ | ||
| findFirstConflictingByteRangeLock(path, desiredLock) { | ||
| const lock = this.locks.get(path); | ||
| findFirstConflictingByteRangeLock(path2, desiredLock) { | ||
| const lock = this.locks.get(path2); | ||
| if (lock === void 0) { | ||
@@ -817,5 +819,5 @@ return void 0; | ||
| releaseLocksForProcess(pid) { | ||
| for (const [path, lock] of this.locks.entries()) { | ||
| for (const [path2, lock] of this.locks.entries()) { | ||
| lock.releaseLocksForProcess(pid); | ||
| this.forgetPathIfUnlocked(path); | ||
| this.forgetPathIfUnlocked(path2); | ||
| } | ||
@@ -843,4 +845,4 @@ } | ||
| */ | ||
| forgetPathIfUnlocked(path) { | ||
| const lock = this.locks.get(path); | ||
| forgetPathIfUnlocked(path2) { | ||
| const lock = this.locks.get(path2); | ||
| if (!lock) { | ||
@@ -851,3 +853,3 @@ return; | ||
| lock.dispose(); | ||
| this.locks.delete(path); | ||
| this.locks.delete(path2); | ||
| } | ||
@@ -865,6 +867,6 @@ } | ||
| */ | ||
| static maybeCreate(path, mode, nativeFlockSync) { | ||
| static maybeCreate(path2, mode, nativeFlockSync) { | ||
| let fd; | ||
| try { | ||
| fd = openSync(path, "a+"); | ||
| fd = openSync(path2, "a+"); | ||
| const flockFlags = mode === "exclusive" ? "exnb" : "shnb"; | ||
@@ -871,0 +873,0 @@ nativeFlockSync(fd, flockFlags); |
+16
-16
| { | ||
| "name": "@php-wasm/node", | ||
| "version": "3.0.38", | ||
| "version": "3.0.39", | ||
| "description": "PHP.wasm for Node.js", | ||
@@ -41,3 +41,3 @@ "repository": { | ||
| "types": "index.d.ts", | ||
| "gitHead": "c49a4f463e0a868247b4e2a847318ca395502de7", | ||
| "gitHead": "ba92e55e300abaadb95b3a89e598af2cd6676951", | ||
| "engines": { | ||
@@ -53,16 +53,16 @@ "node": ">=20.18.3", | ||
| "yargs": "17.7.2", | ||
| "@php-wasm/node-polyfills": "3.0.38", | ||
| "@php-wasm/universal": "3.0.38", | ||
| "@php-wasm/node-8-5": "3.0.38", | ||
| "@php-wasm/node-8-4": "3.0.38", | ||
| "@php-wasm/node-8-3": "3.0.38", | ||
| "@php-wasm/node-8-2": "3.0.38", | ||
| "@php-wasm/node-8-1": "3.0.38", | ||
| "@php-wasm/node-8-0": "3.0.38", | ||
| "@php-wasm/node-7-4": "3.0.38", | ||
| "@php-wasm/node-7-3": "3.0.38", | ||
| "@php-wasm/node-7-2": "3.0.38", | ||
| "@php-wasm/logger": "3.0.38", | ||
| "@php-wasm/util": "3.0.38", | ||
| "@wp-playground/common": "3.0.38" | ||
| "@php-wasm/node-polyfills": "3.0.39", | ||
| "@php-wasm/universal": "3.0.39", | ||
| "@php-wasm/node-8-5": "3.0.39", | ||
| "@php-wasm/node-8-4": "3.0.39", | ||
| "@php-wasm/node-8-3": "3.0.39", | ||
| "@php-wasm/node-8-2": "3.0.39", | ||
| "@php-wasm/node-8-1": "3.0.39", | ||
| "@php-wasm/node-8-0": "3.0.39", | ||
| "@php-wasm/node-7-4": "3.0.39", | ||
| "@php-wasm/node-7-3": "3.0.39", | ||
| "@php-wasm/node-7-2": "3.0.39", | ||
| "@php-wasm/logger": "3.0.39", | ||
| "@php-wasm/util": "3.0.39", | ||
| "@wp-playground/common": "3.0.39" | ||
| }, | ||
@@ -69,0 +69,0 @@ "packageManager": "npm@10.9.2", |
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
30911765
03177
0.16%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated