Documentation

pm_ApiCli
in package

Gateway for execution of CLI utilities

Tags
since
11.0

Table of Contents

RESULT_CODE  = 4
RESULT_EXCEPTION  = 5
RESULT_FULL  = 1
RESULT_STDERR  = 3
RESULT_STDOUT  = 2
call()  : array<string|int, mixed>|int|string
Execute CLI utility (from set provided by panel)
callDomain()  : array<string|int, mixed>|int|string
Execute specified command as domain user
callSbin()  : array<string|int, mixed>|int|string
Execute privileged CLI utility

Constants

RESULT_CODE

public mixed RESULT_CODE = 4

RESULT_EXCEPTION

public mixed RESULT_EXCEPTION = 5

RESULT_FULL

public mixed RESULT_FULL = 1

RESULT_STDERR

public mixed RESULT_STDERR = 3

RESULT_STDOUT

public mixed RESULT_STDOUT = 2

Methods

call()

Execute CLI utility (from set provided by panel)

public static call(string $command[, array<string|int, mixed> $args = [] ][, int $result = 5 ][, array<string|int, mixed> $env = [] ]) : array<string|int, mixed>|int|string
Parameters
$command : string
$args : array<string|int, mixed> = []
$result : int = 5
$env : array<string|int, mixed> = []
Tags
throws
pm_Exception
since
11.0

from CLI only

since
17.0

from anywhere. RESULT_EXCEPTION is default.

Return values
array<string|int, mixed>|int|string

callDomain()

Execute specified command as domain user

public static callDomain(pm_Domain $domain, string $workingDir, string $command[, array<string|int, mixed> $args = [] ][, int $result = 5 ][, array<string|int, mixed> $env = [] ]) : array<string|int, mixed>|int|string
Parameters
$domain : pm_Domain
$workingDir : string
$command : string
$args : array<string|int, mixed> = []
$result : int = 5
$env : array<string|int, mixed> = []
Tags
throws
pm_Exception
since
18.0.34
Return values
array<string|int, mixed>|int|string

callSbin()

Execute privileged CLI utility

public static callSbin(string $command[, array<string|int, mixed> $args = [] ][, int $result = 5 ][, array<string|int, mixed> $env = [] ]) : array<string|int, mixed>|int|string
Parameters
$command : string
$args : array<string|int, mixed> = []
$result : int = 5
$env : array<string|int, mixed> = []
Tags
throws
pm_Exception
since
12.0

Unix only

since
17.0

Windows support

Return values
array<string|int, mixed>|int|string

Search results