PhpExecutor
in package
Table of Contents
Methods
- __construct() : mixed
- __toString() : mixed
- executeCommand() : string
- getExtensionStatus() : bool|null
- getPhpExtensionDir() : string
- getPhpVersion() : int
- getPhpVersionInfo() : string
- isExtensionAvailable() : bool
- isExtensionBuiltIn() : bool
- isValidPhpFile() : bool
- makeCliOption() : string
- makePhpExtensionFileName() : string
Methods
__construct()
public __construct(string $php[,
bool $verbose
= false
]) : mixed
Parameters
- $php : string
-
Path to PHP executable
- $verbose : bool = false
__toString()
public __toString()
: mixed
executeCommand()
public executeCommand(string $command[,
string|null $cliOptions
= null
]) : string
Parameters
- $command : string
-
PHP command to execute
- $cliOptions : string|null = null
-
MUST be properly escaped for the shell
Tags
Return values
string —Result of the command
getExtensionStatus()
public getExtensionStatus(string $extension)
: bool|null
Parameters
- $extension : string
-
Extension name (without .so, .dll, or "php_" prefix)
Return values
bool|null —- true: built in PHP,
- false: available,
- null: not available (not detected).
getPhpExtensionDir()
public getPhpExtensionDir()
: string
Tags
Return values
stringgetPhpVersion()
public getPhpVersion()
: int
Tags
Return values
int —PHP version as a integer
getPhpVersionInfo()
public getPhpVersionInfo()
: string
Tags
Return values
string —PHP version information (multiline information)
isExtensionAvailable()
public isExtensionAvailable(string $extension)
: bool
Parameters
- $extension : string
-
Extension name (without .so, .dll, or "php_" prefix)
Return values
bool —Whether the extension is available for loading into PHP
isExtensionBuiltIn()
public isExtensionBuiltIn(string $extension)
: bool
Parameters
- $extension : string
-
Extension name (without .so, .dll, or "php_" prefix)
Tags
Return values
bool —Whether the extension is built in PHP
isValidPhpFile()
public isValidPhpFile(string $file)
: bool
Parameters
- $file : string
-
Path to file to lint
Return values
bool —Whether the PHP syntax of the file is okay
makeCliOption()
public makeCliOption(string $name,
string $value)
: string
Parameters
- $name : string
- $value : string
Return values
stringmakePhpExtensionFileName()
public makePhpExtensionFileName(string $extension)
: string
Parameters
- $extension : string
-
Extension name (without .so, .dll, or "php_" prefix)