Methods |
public
static
|
getMemoryLimit(): int
Get the configured memory_limit, in bytes
Get the configured memory_limit, in bytes
|
#
|
public
static
|
getMemoryUsagePercent(): float
Get the current memory usage of the script as a percentage of the
memory_limit
Get the current memory usage of the script as a percentage of the
memory_limit
|
#
|
public
static
|
getCpuUsage(): array{int, int}
Get user and system CPU times for the current run, in microseconds
Get user and system CPU times for the current run, in microseconds
Returns
[<user_time>, <system_time>]
|
#
|
public
static
|
getProgramName(?string $parentDir = null): string
Get the filename used to run the script
Get the filename used to run the script
Use $parentDir to get the running script's path relative to a parent
directory.
Throws
|
#
|
public
static
|
getProgramBasename(string ...$suffixes): string
Get the basename of the file used to run the script
Get the basename of the file used to run the script
Parameters
...$suffixes |
Removed from the end of the filename.
|
|
#
|
public
static
|
getTempDir(): string
Get the directory PHP uses for temporary file storage by default
Get the directory PHP uses for temporary file storage by default
Throws
RuntimeException |
if the path returned by
{@see sys_get_temp_dir()} is not a writable directory.
|
|
#
|
public
static
|
getUserId(): int|string
Get the user ID or username of the current user
Get the user ID or username of the current user
|
#
|
public
static
|
isProcessRunning(int $pid): bool
Check if a process with the given process ID is running
Check if a process with the given process ID is running
|
#
|
public
static
|
escapeCommand(string[] $args): string
Get a command string with arguments escaped for this platform's shell
Get a command string with arguments escaped for this platform's shell
Don't use this method to prepare commands for {@see proc_open()}. Its
quoting behaviour on Windows is unstable.
|
#
|
public
static
|
isWindows(): bool
True if the script is running on Windows
True if the script is running on Windows
|
#
|
public
static
|
handleExitSignals(): bool
Make a clean exit from the running script on SIGTERM, SIGINT or SIGHUP
Make a clean exit from the running script on SIGTERM, SIGINT or SIGHUP
Returns
false if signal handlers can't be installed on this
platform, otherwise true .
|
#
|