🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@php-wasm/universal

Package Overview
Dependencies
Maintainers
5
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@php-wasm/universal - npm Package Compare versions

Comparing version

to
1.1.0

2

lib/fs-helpers.d.ts

@@ -1,2 +0,2 @@

import { Emscripten } from './emscripten-types';
import type { Emscripten } from './emscripten-types';
export interface RmDirOptions {

@@ -3,0 +3,0 @@ /**

@@ -0,5 +1,6 @@

import type { CookieStore } from './php-request-handler';
/**
* @public
*/
export declare class HttpCookieStore {
export declare class HttpCookieStore implements CookieStore {
cookies: Record<string, string>;

@@ -6,0 +7,0 @@ rememberCookiesFromResponseHeaders(headers: Record<string, string[]>): void;

@@ -21,7 +21,7 @@ export type { MessageListener, PHPOutput, PHPRunOptions, UniversalPHP, PHPEvent, PHPEventListener, HTTPMethod, PHPRequest, PHPRequestHeaders, SpawnHandler, } from './universal-php';

export { loadPHPRuntime, getLoadedRuntime } from './load-php-runtime';
export type * from './emscripten-types';
export type { Emscripten } from './emscripten-types';
export type { DataModule, EmscriptenOptions, PHPLoaderModule, PHPRuntime, PHPRuntimeId, RuntimeType, } from './load-php-runtime';
export type { PHPRequestHandlerConfiguration, RewriteRule, } from './php-request-handler';
export { PHPRequestHandler, applyRewriteRules } from './php-request-handler';
export type { FileNotFoundGetActionCallback, FileNotFoundToInternalRedirect, FileNotFoundToResponse, FileNotFoundAction, } from './php-request-handler';
export type { FileNotFoundGetActionCallback, FileNotFoundToInternalRedirect, FileNotFoundToResponse, FileNotFoundAction, CookieStore, } from './php-request-handler';
export { rotatePHPRuntime } from './rotate-php-runtime';

@@ -28,0 +28,0 @@ export { writeFiles } from './write-files';

@@ -1,2 +0,2 @@

import { UniversalPHP } from './universal-php';
import type { UniversalPHP } from './universal-php';
/**

@@ -3,0 +3,0 @@ * Reads the php.ini file and returns its entries.

@@ -1,2 +0,2 @@

import { UniversalPHP } from './universal-php';
import type { UniversalPHP } from './universal-php';
export type IteratePhpFilesOptions = {

@@ -3,0 +3,0 @@ /**

/// <reference types="node" />
import { IncomingMessage, Server, ServerResponse } from 'http';
import type { IncomingMessage, Server, ServerResponse } from 'http';
/**

@@ -119,6 +119,6 @@ * Loads the PHP runtime with the given arguments and data dependencies.

* @param phpLoaderModule - The ESM-wrapped Emscripten module. Consult the Dockerfile for the build process.
* @param phpModuleArgs - The Emscripten module arguments, see https://emscripten.org/docs/api_reference/module.html#affecting-execution.
* @param options - The Emscripten module arguments, see https://emscripten.org/docs/api_reference/module.html#affecting-execution.
* @returns Loaded runtime id.
*/
export declare function loadPHPRuntime(phpLoaderModule: PHPLoaderModule, phpModuleArgs?: EmscriptenOptions): Promise<number>;
export declare function loadPHPRuntime(phpLoaderModule: PHPLoaderModule, ...options: EmscriptenOptions[]): Promise<number>;
export type RuntimeType = 'NODE' | 'WEB' | 'WORKER';

@@ -151,3 +151,3 @@ export type PHPRuntimeId = number;

quit?: (status: number, toThrow: any) => void;
onRuntimeInitialized?: () => void;
onRuntimeInitialized?: (phpRuntime: PHPRuntime) => void;
monitorRunDependencies?: (left: number) => void;

@@ -154,0 +154,0 @@ onMessage?: (listener: EmscriptenMessageListener) => void;

@@ -1,2 +0,2 @@

import { PHP } from './php';
import type { PHP } from './php';
export type PHPFactoryOptions = {

@@ -3,0 +3,0 @@ isPrimary: boolean;

@@ -1,5 +0,6 @@

import { PHP } from './php';
import type { PHP } from './php';
import { PHPResponse } from './php-response';
import { PHPRequest } from './universal-php';
import { PHPFactoryOptions, PHPProcessManager } from './php-process-manager';
import type { PHPRequest } from './universal-php';
import type { PHPFactoryOptions } from './php-process-manager';
import { PHPProcessManager } from './php-process-manager';
export type RewriteRule = {

@@ -22,2 +23,18 @@ match: RegExp;

export type FileNotFoundGetActionCallback = (relativePath: string) => FileNotFoundAction;
/**
* Interface for cookie storage implementations.
* This allows different cookie handling strategies to be used with the PHP request handler.
*/
export interface CookieStore {
/**
* Processes and stores cookies from response headers
* @param headers Response headers containing Set-Cookie directives
*/
rememberCookiesFromResponseHeaders(headers: Record<string, string[]>): void;
/**
* Gets the cookie header string for the next request
* @returns Formatted cookie header string
*/
getCookieRequestHeader(): string;
}
interface BaseConfiguration {

@@ -66,3 +83,5 @@ /**

maxPhpInstances?: number;
});
}) & {
cookieStore?: CookieStore | false;
};
/**

@@ -69,0 +88,0 @@ * Handles HTTP requests using PHP runtime as a backend.

@@ -1,7 +0,7 @@

import { EmscriptenDownloadMonitor } from '@php-wasm/progress';
import { PHP } from './php';
import { PHPRequestHandler } from './php-request-handler';
import { PHPResponse } from './php-response';
import { PHPRequest, PHPRunOptions, MessageListener, PHPEvent, PHPEventListener } from './universal-php';
import { RmDirOptions, ListFilesOptions } from './fs-helpers';
import type { EmscriptenDownloadMonitor } from '@php-wasm/progress';
import type { PHP } from './php';
import type { PHPRequestHandler } from './php-request-handler';
import type { PHPResponse } from './php-response';
import type { PHPRequest, PHPRunOptions, MessageListener, PHPEvent, PHPEventListener } from './universal-php';
import type { RmDirOptions, ListFilesOptions } from './fs-helpers';
export type LimitedPHPApi = Pick<PHP, 'request' | 'defineConstant' | 'addEventListener' | 'removeEventListener' | 'mkdir' | 'mkdirTree' | 'readFileAsText' | 'readFileAsBuffer' | 'writeFile' | 'unlink' | 'mv' | 'rmdir' | 'listFiles' | 'isDir' | 'fileExists' | 'chdir' | 'run' | 'onMessage'> & {

@@ -8,0 +8,0 @@ documentRoot: PHP['documentRoot'];

import { PHPResponse } from './php-response';
import type { PHPRuntimeId } from './load-php-runtime';
import { MessageListener, PHPRequest, PHPRequestHeaders, PHPRunOptions, SpawnHandler, PHPEventListener, PHPEvent } from './universal-php';
import { RmDirOptions, ListFilesOptions } from './fs-helpers';
import type { MessageListener, PHPRequest, PHPRequestHeaders, PHPRunOptions, SpawnHandler, PHPEventListener, PHPEvent } from './universal-php';
import type { RmDirOptions, ListFilesOptions } from './fs-helpers';
import { Semaphore } from '@php-wasm/util';
import { PHPRequestHandler } from './php-request-handler';
import { Emscripten } from './emscripten-types';
import type { PHPRequestHandler } from './php-request-handler';
import type { Emscripten } from './emscripten-types';
export declare const __private__dont__use: unique symbol;
type ErrorSource = 'request' | 'php-wasm';
export declare class PHPExecutionFailureError extends Error {
response: PHPResponse;
source: 'request' | 'php-wasm';
constructor(message: string, response: PHPResponse, source: 'request' | 'php-wasm');
source: ErrorSource;
constructor(message: string, response: PHPResponse, source: ErrorSource);
}

@@ -348,1 +349,2 @@ export type UnmountFunction = (() => Promise<any>) | (() => any);

export declare function normalizeHeaders(headers: PHPRequestHeaders): PHPRequestHeaders;
export {};

@@ -1,2 +0,2 @@

import { PHP } from './php';
import type { PHP } from './php';
/**

@@ -3,0 +3,0 @@ * Proxy specific paths to the parent's MEMFS instance.

@@ -18,2 +18,2 @@ /**

export declare function getEmscriptenFsError(e: any): any;
export declare function rethrowFileSystemError(messagePrefix?: string): (target: any, methodName: string, descriptor: PropertyDescriptor) => void;
export declare function rethrowFileSystemError(messagePrefix?: string): (value: (...args: any[]) => any) => (...args: any[]) => any;

@@ -1,2 +0,2 @@

import { PHP } from './php';
import type { PHP } from './php';
export interface RotateOptions {

@@ -3,0 +3,0 @@ php: PHP;

@@ -1,2 +0,2 @@

import { UniversalPHP } from './universal-php';
import type { UniversalPHP } from './universal-php';
/**

@@ -3,0 +3,0 @@ * Reads a file from PHP filesystem using a stream.

@@ -1,4 +0,4 @@

export declare const SupportedPHPVersions: readonly ["8.4", "8.3", "8.2", "8.1", "8.0", "7.4", "7.3", "7.2", "7.1", "7.0"];
export declare const SupportedPHPVersions: readonly ["8.4", "8.3", "8.2", "8.1", "8.0", "7.4", "7.3", "7.2"];
export declare const LatestSupportedPHPVersion: "8.4";
export declare const SupportedPHPVersionsList: string[];
export type SupportedPHPVersion = (typeof SupportedPHPVersions)[number];

@@ -1,3 +0,3 @@

import { Remote } from 'comlink';
import { LimitedPHPApi } from './php-worker';
import type { Remote } from 'comlink';
import type { LimitedPHPApi } from './php-worker';
/**

@@ -4,0 +4,0 @@ * Represents an event related to the PHP request.

@@ -1,2 +0,2 @@

import { UniversalPHP } from './universal-php';
import type { UniversalPHP } from './universal-php';
/**

@@ -3,0 +3,0 @@ * Writes streamed files to PHP filesystem.

@@ -1,2 +0,4 @@

import { UniversalPHP } from './universal-php';
import type { UniversalPHP } from './universal-php';
export interface FileTree extends Record<string, Uint8Array | string | FileTree> {
}
export interface WriteFilesOptions {

@@ -9,4 +11,2 @@ /**

}
export interface FileTree extends Record<string, Uint8Array | string | FileTree> {
}
/**

@@ -13,0 +13,0 @@ * Writes multiple files to a specified directory in the Playground

{
"name": "@php-wasm/universal",
"version": "1.0.29",
"version": "1.1.0",
"description": "PHP.wasm – emscripten bindings for PHP",

@@ -40,6 +40,6 @@ "repository": {

"license": "GPL-2.0-or-later",
"gitHead": "173e69f62e1b43bd7353b875054bb1ef5e394de8",
"gitHead": "9dbbe2b22ccbacda9c0da4444c51d5739e784302",
"engines": {
"node": ">=18.18.0",
"npm": ">=8.11.0"
"node": ">=20.18.3",
"npm": ">=10.1.0"
},

@@ -49,8 +49,15 @@ "dependencies": {

"ini": "4.1.2",
"@php-wasm/node-polyfills": "1.0.29",
"@php-wasm/logger": "1.0.29",
"@php-wasm/util": "1.0.29",
"@php-wasm/stream-compression": "1.0.29",
"@php-wasm/progress": "1.0.29"
"@php-wasm/node-polyfills": "1.1.0",
"@php-wasm/logger": "1.1.0",
"@php-wasm/util": "1.1.0",
"@php-wasm/stream-compression": "1.1.0",
"@php-wasm/progress": "1.1.0"
},
"overrides": {
"rollup": "^4.34.6",
"react": "18.3.1",
"react-dom": "18.3.1",
"typescript": "5.4.5",
"ws": "^8.18.0"
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet