class Sys extends SysEnv

Class Sys

Methods

static bool
isUnix()

No description

from SysEnv
static bool
isLinux()

No description

from SysEnv
static bool
isWin()

No description

from SysEnv
static bool
isWindows()

No description

from SysEnv
static bool
isMac()

No description

from SysEnv
static bool
isRoot()

No description

from SysEnv
static string
getHostname()

No description

from SysEnv
static string
getNullDevice()

No description

from SysEnv
static boolean
isSupportColor()

Returns true if STDOUT supports colorization.

from SysEnv
static boolean
isInteractive(int|resource $fileDescriptor)

Returns if the file descriptor is an interactive terminal or not.

from SysEnv
static 
execInBackground(string $cmd)

run a command in background

static mixed
exec(string $command, null|string $logfile = null, null|string $user = null)

No description

static array
runCommand($command, bool $returnStatus = true)

Method to execute a command in the sys Uses : 1. system 2. passthru 3. exec 4. shell_exec

static string
getTempDir()

No description

static int|string
getCpuUsage(string $program)

No description

static int|string
getMemUsage($program)

No description

static 
gitCheck()

支持查看指定目录,默认当前目录 CLI: php test.php -d=path php test.php --dir=path WEB: /test.php?dir=path

Details

in SysEnv at line 24
static bool isUnix()

Return Value

bool

in SysEnv at line 34
static bool isLinux()

Return Value

bool

in SysEnv at line 42
static bool isWin()

Return Value

bool

in SysEnv at line 50
static bool isWindows()

Return Value

bool

in SysEnv at line 58
static bool isMac()

Return Value

bool

in SysEnv at line 66
static bool isRoot()

Return Value

bool

in SysEnv at line 78
static string getHostname()

Return Value

string

in SysEnv at line 86
static string getNullDevice()

Return Value

string

in SysEnv at line 101
static boolean isSupportColor()

Returns true if STDOUT supports colorization.

This code has been copied and adapted from \Symfony\Component\Console\Output\OutputStream.

Return Value

boolean

in SysEnv at line 124
static boolean isInteractive(int|resource $fileDescriptor)

Returns if the file descriptor is an interactive terminal or not.

Parameters

int|resource $fileDescriptor

Return Value

boolean

at line 21
static execInBackground(string $cmd)

run a command in background

Parameters

string $cmd

at line 37
static mixed exec(string $command, null|string $logfile = null, null|string $user = null)

Parameters

string $command
null|string $logfile
null|string $user

Return Value

mixed

Exceptions

RuntimeException

at line 70
static array runCommand($command, bool $returnStatus = true)

Method to execute a command in the sys Uses : 1. system 2. passthru 3. exec 4. shell_exec

Parameters

$command
bool $returnStatus

Return Value

array

at line 114
static string getTempDir()

Return Value

string

at line 137
static int|string getCpuUsage(string $program)

Parameters

string $program

Return Value

int|string

at line 152
static int|string getMemUsage($program)

Parameters

$program

Return Value

int|string

at line 172
static gitCheck()

支持查看指定目录,默认当前目录 CLI: php test.php -d=path php test.php --dir=path WEB: /test.php?dir=path