SystemInformation: ezcSystemInfo
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcSystemInfo
|
Provides access to common system variables. [
source]
Variables that not available from PHP directly are fetched using readers specific for each supported system. óorresponding reader automatically detected, attached and forced to scan system info during initialisation. Exception throws if reader can't scan sistem info.
Available readers are:
Readers for otner systems could be added by implementing the
ezcSystemInfoReader interface.
The ezcSystemInfo class has the following properties:
Reader independent, these properties are availiable even if system reader was not initialized.
- String osType, OS type (e.g 'unix') or null.
- String osName, OS name (e.g 'Linux') or null.
- String fileSystemType, filesystem type (e.g 'linux') or null.
- String lineSeparator, which is used for line separators on the current OS.
- String backupFileName, backup filename for this platform, '.bak' for win32
and '~' for unix and mac.
- Array phpVersion, with PHP version (e.g. array(5,1,1) )
- ezcSystemInfoAccelerator phpAccelerator, structure with PHP accelerator info or null
ezcSystemInfoAccelerator.
- Bool isShellExecution, flag indicates if the script executed over the web or the shell/command line.
Reader dependent, these properties are not availiable if reader was not intnialized and didn't scan OS:
- Integer cpuCount amount of CPUs in system or null .
- String cpuType CPU type string (e.g 'AMD Sempron(tm) Processor 3000+') or null.
- Float cpuSpeed CPU speed as float (e.g 1808.743) or null.
- Integer memorySize Memory Size in bytes int (e.g. 528424960) or null.
Example:
1. $info = ezcSystemInfo::getInstance();
2. echo 'Processors: ', $info->cpuCount, "\n";
3. echo 'CPU Type: ', $info->cpuType, "\n";
4. echo 'CPU Speed: ', $info->cpuSpeed, "\n";
Method Summary
|
public static ezcSystemInfo |
getInstance(
)
Returns the single instance of the ezcSystemInfo class |
|
public static bool |
isShellExecution(
)
Determins if the script got executed over the web or the shell/command line. |
|
public static ezcSystemInfoAccelerator |
phpAccelerator(
)
Detects if a PHP accelerator running and what type it is if one found. |
|
public static array |
phpVersion(
)
Returns the PHP version as an array with the version elements. |
|
public mixed |
__get(
$property )
Property read access. |
Methods
getInstance
Returns the single instance of the ezcSystemInfo class
Throws
| Class | Description |
ezcSystemInfoReaderCantScanOSException |
If system variables can't be received from OS. |
isShellExecution
bool isShellExecution(
)
Determins if the script got executed over the web or the shell/command line.
phpAccelerator
Detects if a PHP accelerator running and what type it is if one found.
phpVersion
array phpVersion(
)
Returns the PHP version as an array with the version elements.
__get
mixed __get(
string
$property )
Property read access.
Parameters
| Name |
Type |
Description |
$property |
string |
Name of the property. |
Throws
| Class | Description |
ezcBasePropertyNotFoundException |
If the the desired property is not found. |
Last updated: Thu, 01 Nov 2007