pexec

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package pexec exposes process execution to PHP: the ref.exec.php functions that run a command through the shell, the two that quote for it, and posix_getpid and getmypid, which name the running process.

Running a command leaves the fs.FS sandbox behind on purpose. A process reads and writes with the permissions of the user running the server, and writable_paths does not reach it; a host that runs untrusted scripts leaves this package out. What the runtime does say is where a command starts, which is the working directory chdir() moved, resolved onto the host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(rt *runner.Runtime)

Register installs the process bindings rooted at the process working directory. A host serving scripts out of a project directory binds that instead, with RegisterRoot.

func RegisterRoot added in v0.5.0

func RegisterRoot(rt *runner.Runtime, dir string)

RegisterRoot installs the process bindings with commands rooted at dir, the directory the filesystem shims are bound to. It replaces whatever root was installed before it, so a host calls it after stdlib.Register, the way stdlib.RegisterFS does for the filesystem.

An empty dir leaves a command in the process working directory, which is what a host that bound no directory of its own has to fall back to.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL