Skip to main content

@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; print?: (message: string) => void; printErr?: (message: string) => void; quit?: (status: number, toThrow: any) => void } & Record<string, any>

HTTPMethod

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

IsomorphicRemotePHP

IsomorphicRemotePHP: Remote<Omit<IsomorphicLocalPHP, setSapiName | setPhpIniEntry | setPhpIniPath>>

The omited methods must either be called synchronously before the PHP internal state is initialized, or with a complex argument that can’t be serialized over a remote connection. Therefeore, they don’t make sense in a remote PHP instance.

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

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<PHP>: (options: PHPFactoryOptions) => Promise<PHP>

Type parameters

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<PHP>: BaseConfiguration & ({ processManager: PHPProcessManager<PHP> } | { maxPhpInstances?: number; phpFactory: (requestHandler: PHPRequestHandlerFactoryArgs<PHP>) => Promise<PHP> })

Type parameters

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

SupportedPHPExtension

SupportedPHPExtension: iconv | mbstring | xml-bundle | gd

SupportedPHPExtensionBundle

SupportedPHPExtensionBundle: kitchen-sink | light

SupportedPHPVersion

SupportedPHPVersion: typeof SupportedPHPVersions[number]

UniversalPHP

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 = ...

constSupportedPHPExtensionBundles

SupportedPHPExtensionBundles: { kitchen-sink: string[]; light: never[] } = ...

Type declaration

  • kitchen-sink: string[]
  • light: never[]

constSupportedPHPExtensionsList

SupportedPHPExtensionsList: string[] = ...

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 = ...