Platform
Platform utility class. This class provides methods to detect the platform (OS) on which the application is running, check if it is running from a Phar archive, and open URLs in the system's default browser.
Table of Contents
Constants
- OS_LINUX = 3
- OS_OSX = 4
- OS_UNKNOWN = 1
- OS_WIN = 2
- OS_OSX = 4
Properties
- $pharPath : string
Methods
- getOS() : int
- Search for system OS in PHP_OS constant.
- getPharPath() : string
- Returns the full path on disk to the currently executing Phar archive.
- isPhar() : bool
- Running from Phar or not?
- isWindows() : bool
- Whether the host machine is running a Windows OS.
- openBrowser() : void
- Opens a URL in the system default browser.
Constants
OS_LINUX
public
mixed
OS_LINUX
= 3
OS_OSX
public
mixed
OS_OSX
= 4
OS_UNKNOWN
public
mixed
OS_UNKNOWN
= 1
OS_WIN
public
mixed
OS_WIN
= 2
Properties
$pharPath
protected
static string
$pharPath
Methods
getOS()
Search for system OS in PHP_OS constant.
public
static getOS() : int
Return values
intgetPharPath()
Returns the full path on disk to the currently executing Phar archive.
public
static getPharPath() : string
Return values
stringisPhar()
Running from Phar or not?
public
static isPhar() : bool
Return values
boolisWindows()
Whether the host machine is running a Windows OS.
public
static isWindows() : bool
Return values
boolopenBrowser()
Opens a URL in the system default browser.
public
static openBrowser(string $url) : void
Parameters
- $url : string