Aller au contenu principal

@php-wasm/universal

Index

Type Aliases

DataModule

DataModule: { default: (phpRuntime: PHPRuntime) => void; dependenciesTotalSize: number; dependencyFilename: string }

Type declaration

  • default: (phpRuntime: PHPRuntime) => void
  • dependenciesTotalSize: number
  • dependencyFilename: string

EmscriptenOptions

EmscriptenOptions: { ENV?: Record<string, string>; debug?: boolean; instantiateWasm?: (info: WebAssembly.Imports, receiveInstance: (instance: WebAssembly.Instance, module: WebAssembly.Module) => void) => void; locateFile?: (path: string) => string; monitorRunDependencies?: (left: number) => void; noInitialRun?: boolean; onAbort?: (message: string) => void; onMessage?: (listener: EmscriptenMessageListener) => void; onRuntimeInitialized?: () => void; outboundNetworkProxyServer?: Server<typeof IncomingMessage, typeof ServerResponse>; print?: (message: string) => void; printErr?: (message: string) => void; quit?: (status: number, toThrow: any) => void } & Record<string, any>

FileNotFoundAction

FileNotFoundAction: FileNotFoundToResponse | FileNotFoundToInternalRedirect | FileNotFoundTo404

FileNotFoundGetActionCallback

FileNotFoundGetActionCallback: (relativePath: string) => FileNotFoundAction

Type declaration

FileNotFoundToInternalRedirect

FileNotFoundToInternalRedirect: { type: internal-redirect; uri: string }

Type declaration

  • type: internal-redirect
  • uri: string

FileNotFoundToResponse

FileNotFoundToResponse: { response: PHPResponse; type: response }

Type declaration

HTTPMethod

HTTPMethod: GET | POST | HEAD | OPTIONS | PATCH | PUT | DELETE

IterateFilesOptions

IterateFilesOptions: { exceptPaths?: string[]; pathPrefix?: string; relativePaths?: boolean }

Type declaration

  • optionalexceptPaths?: string[]

    A list of paths to exclude from the results.

  • optionalpathPrefix?: string

    A prefix to add to all paths. Only used if relativePaths is true.

  • optionalrelativePaths?: boolean

    Should yield paths relative to the root directory? If false, all paths will be absolute.

MessageListener

MessageListener: (data: string) => Promise<string | Uint8Array | void> | string | void

Type declaration

    • (data: string): Promise<string | Uint8Array | void> | string | void
    • Parameters

      • data: string

      Returns Promise<string | Uint8Array | void> | string | void

MountHandler

MountHandler: (php: PHP, FS: Emscripten.RootFS, vfsMountPoint: string) => UnmountFunction | Promise<UnmountFunction>

Type declaration

PHPEvent

PHPEvent: PHPRequestEndEvent | PHPRequestErrorEvent | PHPRuntimeInitializedEvent | PHPRuntimeBeforeDestroyEvent

Represents an event related to the PHP instance. This is intentionally not an extension of CustomEvent to make it isomorphic between different JavaScript runtimes.

PHPEventListener

PHPEventListener: (event: PHPEvent) => void

Type declaration

    • A callback function that handles PHP events.


      Parameters

      Returns void

PHPFactory

PHPFactory: (options: PHPFactoryOptions) => Promise<PHP>

Type declaration

PHPFactoryOptions

PHPFactoryOptions: { isPrimary: boolean }

Type declaration

  • isPrimary: boolean

PHPLoaderModule

PHPLoaderModule: { dependenciesTotalSize: number; dependencyFilename: string; init: (jsRuntime: string, options: EmscriptenOptions) => PHPRuntime }

Type declaration

PHPRequestHandlerConfiguration

PHPRequestHandlerConfiguration: BaseConfiguration & ({ processManager: PHPProcessManager } | { maxPhpInstances?: number; phpFactory: (requestHandler: PHPRequestHandlerFactoryArgs) => Promise<PHP> })

PHPRequestHeaders

PHPRequestHeaders: Record<string, string>

PHPRuntime

PHPRuntime: any

PHPRuntimeId

PHPRuntimeId: number

RewriteRule

RewriteRule: { match: RegExp; replacement: string }

Type declaration

  • match: RegExp
  • replacement: string

RuntimeType

RuntimeType: NODE | WEB | WORKER

SpawnHandler

SpawnHandler: (command: string, args: string[]) => ChildProcess

Type declaration

    • (command: string, args: string[]): ChildProcess
    • Parameters

      • command: string
      • args: string[]

      Returns ChildProcess

SupportedPHPVersion

SupportedPHPVersion: typeof SupportedPHPVersions[number]

UniversalPHP

UniversalPHP: LimitedPHPApi | Remote<LimitedPHPApi>

UnmountFunction

UnmountFunction: () => Promise<any> | () => any

Variables

constDEFAULT_BASE_URL

DEFAULT_BASE_URL: http://example.com = 'http://example.com'

The default base used to convert a path into the URL object.

constLatestSupportedPHPVersion

LatestSupportedPHPVersion: 8.3 = ...

constSupportedPHPVersions

SupportedPHPVersions: readonly [8.3, 8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1, 7.0] = ...

constSupportedPHPVersionsList

SupportedPHPVersionsList: string[] = ...

const__private__dont__use

__private__dont__use: typeof __private__dont__use = ...