Cecil

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

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

Properties

$pharPath

protected static string $pharPath

Methods

getOS()

Search for system OS in PHP_OS constant.

public static getOS() : int
Return values
int

getPharPath()

Returns the full path on disk to the currently executing Phar archive.

public static getPharPath() : string
Return values
string

isPhar()

Running from Phar or not?

public static isPhar() : bool
Return values
bool

isWindows()

Whether the host machine is running a Windows OS.

public static isWindows() : bool
Return values
bool

openBrowser()

Opens a URL in the system default browser.

public static openBrowser(string $url) : void
Parameters
$url : string
 
On this page

Search results