@php-wasm/node-5-2 3.1.20

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/index.cjs ADDED
@@ -0,0 +1,74 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // packages/php-wasm/node-builds/5-2/src/index.ts
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ getIntlExtensionPath: () => getIntlExtensionPath,
33
+ getMemcachedExtensionPath: () => getMemcachedExtensionPath,
34
+ getPHPLoaderModule: () => getPHPLoaderModule,
35
+ getRedisExtensionPath: () => getRedisExtensionPath,
36
+ getXdebugExtensionPath: () => getXdebugExtensionPath,
37
+ jspi: () => import_wasm_feature_detect.jspi
38
+ });
39
+ module.exports = __toCommonJS(src_exports);
40
+ var import_wasm_feature_detect = require("wasm-feature-detect");
41
+ var import_node_url = require("node:url");
42
+ var import_node_path = require("node:path");
43
+ var import_node_fs = require("node:fs");
44
+ var import_meta = {};
45
+ var currentDirPath = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
46
+ var packageRoot = (0, import_node_fs.existsSync)((0, import_node_path.join)(currentDirPath, "jspi")) ? currentDirPath : (0, import_node_path.dirname)(currentDirPath);
47
+ async function getPHPLoaderModule() {
48
+ if (await (0, import_wasm_feature_detect.jspi)()) {
49
+ return await import("./jspi/php_5_2.js");
50
+ } else {
51
+ return await import("./asyncify/php_5_2.js");
52
+ }
53
+ }
54
+ async function getIntlExtensionPath() {
55
+ throw new Error("The intl extension is not available for PHP 5.2.");
56
+ }
57
+ async function getXdebugExtensionPath() {
58
+ throw new Error("The Xdebug extension is not available for PHP 5.2.");
59
+ }
60
+ async function getRedisExtensionPath() {
61
+ throw new Error("The Redis extension is not available for PHP 5.2.");
62
+ }
63
+ async function getMemcachedExtensionPath() {
64
+ throw new Error("The Memcached extension is not available for PHP 5.2.");
65
+ }
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ getIntlExtensionPath,
69
+ getMemcachedExtensionPath,
70
+ getPHPLoaderModule,
71
+ getRedisExtensionPath,
72
+ getXdebugExtensionPath,
73
+ jspi
74
+ });
package/index.js ADDED
@@ -0,0 +1,34 @@
1
+ // packages/php-wasm/node-builds/5-2/src/index.ts
2
+ import { jspi } from "wasm-feature-detect";
3
+ import { fileURLToPath } from "node:url";
4
+ import { dirname, join } from "node:path";
5
+ import { existsSync } from "node:fs";
6
+ var currentDirPath = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
7
+ var packageRoot = existsSync(join(currentDirPath, "jspi")) ? currentDirPath : dirname(currentDirPath);
8
+ async function getPHPLoaderModule() {
9
+ if (await jspi()) {
10
+ return await import("./jspi/php_5_2.js");
11
+ } else {
12
+ return await import("./asyncify/php_5_2.js");
13
+ }
14
+ }
15
+ async function getIntlExtensionPath() {
16
+ throw new Error("The intl extension is not available for PHP 5.2.");
17
+ }
18
+ async function getXdebugExtensionPath() {
19
+ throw new Error("The Xdebug extension is not available for PHP 5.2.");
20
+ }
21
+ async function getRedisExtensionPath() {
22
+ throw new Error("The Redis extension is not available for PHP 5.2.");
23
+ }
24
+ async function getMemcachedExtensionPath() {
25
+ throw new Error("The Memcached extension is not available for PHP 5.2.");
26
+ }
27
+ export {
28
+ getIntlExtensionPath,
29
+ getMemcachedExtensionPath,
30
+ getPHPLoaderModule,
31
+ getRedisExtensionPath,
32
+ getXdebugExtensionPath,
33
+ jspi
34
+ };
Binary file