Host
in package
implements
ResourceDetectorInterface
FinalYes
Tags
Table of Contents
Interfaces
Constants
- PATH_ETC_HOSTID : mixed = 'etc/hostid'
- PATH_ETC_MACHINEID : mixed = 'etc/machine-id'
- PATH_VAR_LIB_DBUS_MACHINEID : mixed = 'var/lib/dbus/machine-id'
Properties
Methods
- __construct() : mixed
- getResource() : ResourceInfo
- getBsdId() : string|null
- getLinuxId() : string|null
- getMachineId() : string|null
- getMacOsId() : string|null
- getWindowsId() : string|null
- readFile() : string|false
- run() : string|null
- The first element must be an absolute path. An argument list avoids the shell, but proc_open() still searches PATH for a bare name, and is_executable() checks a bare name against the current directory instead, so it would not stop one.
Constants
PATH_ETC_HOSTID
private
mixed
PATH_ETC_HOSTID
= 'etc/hostid'
PATH_ETC_MACHINEID
private
mixed
PATH_ETC_MACHINEID
= 'etc/machine-id'
PATH_VAR_LIB_DBUS_MACHINEID
private
mixed
PATH_VAR_LIB_DBUS_MACHINEID
= 'var/lib/dbus/machine-id'
Properties
$dir read-only
private
string
$dir
= '/'
$os read-only
private
string
$os
= PHP_OS_FAMILY
Methods
__construct()
public
__construct([string $dir = '/' ][, string $os = PHP_OS_FAMILY ]) : mixed
Parameters
- $dir : string = '/'
- $os : string = PHP_OS_FAMILY
getResource()
public
getResource() : ResourceInfo
Attributes
- #[Override]
Return values
ResourceInfogetBsdId()
private
getBsdId() : string|null
Return values
string|nullgetLinuxId()
private
getLinuxId() : string|null
Return values
string|nullgetMachineId()
private
getMachineId() : string|null
Return values
string|nullgetMacOsId()
private
getMacOsId() : string|null
Return values
string|nullgetWindowsId()
private
getWindowsId() : string|null
Return values
string|nullreadFile()
private
readFile(string $file) : string|false
Parameters
- $file : string
Tags
Return values
string|falserun()
The first element must be an absolute path. An argument list avoids the shell, but proc_open() still searches PATH for a bare name, and is_executable() checks a bare name against the current directory instead, so it would not stop one.
private
run(array<int, string> $command) : string|null
Parameters
- $command : array<int, string>