// packages/php-wasm/node-builds/7-2/src/index.ts
import { jspi } from "wasm-feature-detect";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
import { existsSync } from "node:fs";
var currentDirPath = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
var packageDir = existsSync(join(currentDirPath, "jspi")) ? currentDirPath : dirname(currentDirPath);
async function getPHPLoaderModule() {
  if (await jspi()) {
    return await import("./jspi/php_7_2.js");
  } else {
    return await import("./asyncify/php_7_2.js");
  }
}
async function getIntlExtensionPath() {
  if (await jspi()) {
    return join(packageDir, "jspi/extensions/intl/7_2/intl.so");
  } else {
    return join(packageDir, "asyncify/extensions/intl/7_2/intl.so");
  }
}
async function getXdebugExtensionPath() {
  if (await jspi()) {
    return join(packageDir, "jspi/extensions/xdebug/7_2/xdebug.so");
  } else {
    return join(packageDir, "asyncify/extensions/xdebug/7_2/xdebug.so");
  }
}
export {
  getIntlExtensionPath,
  getPHPLoaderModule,
  getXdebugExtensionPath,
  jspi
};
