PHP 8.4.1 Released!

The LuaSandbox class

(PECL luasandbox >= 1.0.0)

Introdução

The LuaSandbox class creates a Lua environment and allows for execution of Lua code.

Resumo da classe

class LuaSandbox {
/* Constantes */
const int SAMPLES = 0;
const int SECONDS = 1;
const int PERCENT = 2;
/* Métodos */
public callFunction(string $name, mixed ...$args): array|bool
public enableProfiler(float $period = 0.02): bool
public getCPUUsage(): float
public getProfilerFunctionReport(int $units = LuaSandbox::SECONDS): array
public static getVersionInfo(): array
public loadBinary(string $code, string $chunkName = ''): LuaSandboxFunction
public loadString(string $code, string $chunkName = ''): LuaSandboxFunction
public registerLibrary(string $libname, array $functions): void
public setCPULimit(float|bool $limit): void
public setMemoryLimit(int $limit): void
}

Constantes predefinidas

LuaSandbox::SAMPLES

Used with LuaSandbox::getProfilerFunctionReport() to return timings in samples.

LuaSandbox::SECONDS

Used with LuaSandbox::getProfilerFunctionReport() to return timings in seconds.

LuaSandbox::PERCENT

Used with LuaSandbox::getProfilerFunctionReport() to return timings in percentages of the total.

Índice

adicione uma nota

Notas Enviadas por Usuários (em inglês)

Não há notas de usuários para esta página.
To Top