@php-wasm/universal 3.0.14 → 3.0.16

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.js CHANGED
@@ -1475,7 +1475,8 @@ class PHP {
1475
1475
  * @param path - The directory path to create.
1476
1476
  */
1477
1477
  mkdir(t) {
1478
- return FSHelpers.mkdir(this[__private__dont__use].FS, t);
1478
+ const e = FSHelpers.mkdir(this[__private__dont__use].FS, t);
1479
+ return this.dispatchEvent({ type: "filesystem.write" }), e;
1479
1480
  }
1480
1481
  /**
1481
1482
  * @deprecated Use mkdir instead.
@@ -1511,7 +1512,12 @@ class PHP {
1511
1512
  * @param data - The data to write to the file.
1512
1513
  */
1513
1514
  writeFile(t, e) {
1514
- return FSHelpers.writeFile(this[__private__dont__use].FS, t, e);
1515
+ const r = FSHelpers.writeFile(
1516
+ this[__private__dont__use].FS,
1517
+ t,
1518
+ e
1519
+ );
1520
+ return this.dispatchEvent({ type: "filesystem.write" }), r;
1515
1521
  }
1516
1522
  /**
1517
1523
  * Removes a file from the PHP filesystem.
@@ -1520,7 +1526,8 @@ class PHP {
1520
1526
  * @param path - The file path to remove.
1521
1527
  */
1522
1528
  unlink(t) {
1523
- return FSHelpers.unlink(this[__private__dont__use].FS, t);
1529
+ const e = FSHelpers.unlink(this[__private__dont__use].FS, t);
1530
+ return this.dispatchEvent({ type: "filesystem.write" }), e;
1524
1531
  }
1525
1532
  /**
1526
1533
  * Moves a file or directory in the PHP filesystem to a
@@ -1530,7 +1537,12 @@ class PHP {
1530
1537
  * @param newPath The new path.
1531
1538
  */
1532
1539
  mv(t, e) {
1533
- return FSHelpers.mv(this[__private__dont__use].FS, t, e);
1540
+ const r = FSHelpers.mv(
1541
+ this[__private__dont__use].FS,
1542
+ t,
1543
+ e
1544
+ );
1545
+ return this.dispatchEvent({ type: "filesystem.write" }), r;
1534
1546
  }
1535
1547
  /**
1536
1548
  * Removes a directory from the PHP filesystem.
@@ -1539,7 +1551,12 @@ class PHP {
1539
1551
  * @param options Options for the removal.
1540
1552
  */
1541
1553
  rmdir(t, e = { recursive: !0 }) {
1542
- return FSHelpers.rmdir(this[__private__dont__use].FS, t, e);
1554
+ const r = FSHelpers.rmdir(
1555
+ this[__private__dont__use].FS,
1556
+ t,
1557
+ e
1558
+ );
1559
+ return this.dispatchEvent({ type: "filesystem.write" }), r;
1543
1560
  }
1544
1561
  /**
1545
1562
  * Lists the files and directories in the given directory.
@@ -3767,6 +3784,7 @@ export {
3767
3784
  exposeSyncAPI,
3768
3785
  getLoadedRuntime,
3769
3786
  getPhpIniEntries,
3787
+ inferMimeType,
3770
3788
  isExitCode,
3771
3789
  isPathToSharedFS,
3772
3790
  iteratePhpFiles as iterateFiles,