PHP Class N98\Util\OperatingSystem

ファイルを表示 Open project: netz98/n98-magerun Class Usage Examples

Public Methods

Method Description
getCwd ( ) : string get current working directory
getHomeDir ( ) : string | false Home directory of the current user
getPhpBinary ( ) : string Retrieve path to php binary
isLinux ( ) : boolean Returns true if operating system is based on GNU linux.
isMacOs ( ) : boolean Returns true if operating system is based on apple MacOS.
isNetware ( ) : boolean Returns true if operating system is based on novell netware.
isProgramInstalled ( string $program ) : boolean
isRoot ( ) : boolean Test for Root UID on a POSIX system if posix_getuid() is available.
isWindows ( ) : boolean Returns true if operating system is based on Microsoft Windows.

Method Details

getCwd() public static method

get current working directory
public static getCwd ( ) : string
return string the current working directory on success, or false on failure.

getHomeDir() public static method

Home directory of the current user
public static getHomeDir ( ) : string | false
return string | false false in case there is no environment variable related to the home directory

getPhpBinary() public static method

Retrieve path to php binary
public static getPhpBinary ( ) : string
return string

isLinux() public static method

Returns true if operating system is based on GNU linux.
public static isLinux ( ) : boolean
return boolean

isMacOs() public static method

Returns true if operating system is based on apple MacOS.
public static isMacOs ( ) : boolean
return boolean

isNetware() public static method

Returns true if operating system is based on novell netware.
public static isNetware ( ) : boolean
return boolean

isProgramInstalled() public static method

public static isProgramInstalled ( string $program ) : boolean
$program string
return boolean

isRoot() public static method

Returns false negatives if posix_getuid() is not available.
public static isRoot ( ) : boolean
return boolean

isWindows() public static method

Returns true if operating system is based on Microsoft Windows.
public static isWindows ( ) : boolean
return boolean