Skip to main content

proxyFileSystem

Callable

  • proxyFileSystem(sourceOfTruth: PHP, replica: PHP, paths: string[]): void

  • Mounts directories from one PHP instance's filesystem into another using PROXYFS.

    This enables file sharing between PHP instances without duplicating the files in memory. For example, mounting /wordpress from the parent instance into a child worker allows both to access the same WordPress installation without copying the entire directory.

    The function automatically patches PROXYFS with mmap support before mounting, ensuring libraries like ICU can memory-map data files through the proxied filesystem.


    Parameters

    • sourceOfTruth: PHP

      The PHP instance containing the original files

    • replica: PHP

      The PHP instance that will access files through PROXYFS

    • paths: string[]

      Absolute paths to mount (e.g., ['/wordpress', '/internal/shared'])

    Returns void