| Methods |
public
static
|
cliHardCoded(): array
Gets a list of hard coded php.ini settings when in the cli sapi. Last updated on php 8.5.
Gets a list of hard coded php.ini settings when in the cli sapi. Last updated on php 8.5.
|
#
|
public
static
|
replaceLineBeginingWith(array &$lines, string $starting, string $replacement): boolean
Goes over a list of lines and replaces the first line that starts with a specific string.
Goes over a list of lines and replaces the first line that starts with a specific string.
Parameters
| $lines |
The list of lines.
|
| $starting |
What the line to replace starts with.
|
| $replacement |
What to replace the line with.
|
Returns
Weather a line was found and replaced.
|
#
|
public
static
|
doesSettingsMatch(array $expected): boolean
Checks weather some php.ini settings match expected values.
Checks weather some php.ini settings match expected values.
Parameters
| $expected |
The expected values, the keys are ini_get names and the values are compared to ini_get return.
|
Returns
Weather all the specified settings match.
|
#
|
public
static
|
iniPath(): string|null
Gets the loaded php.ini file, and checks existance.
Gets the loaded php.ini file, and checks existance.
Returns
The path on success or null on failure.
|
#
|
public
static
|
backupIni(): boolean
Backs up the loaded php.ini.
Backs up the loaded php.ini.
Returns
Weather the backup was successful.
|
#
|
public
static
|
loadIni(boolean $checkWriteable = true): array|null
Reads the current php.ini using file() and returns the lines in a list.
Reads the current php.ini using file() and returns the lines in a list.
Parameters
| $checkWriteable |
Weather to check if the file is writable.
|
Returns
The lines on success or null on failure.
|
#
|
public
static
|
setSettingsOnLines(array &$lines, array $settings): boolean
Sets php.ini settings given a list of lines.
Sets php.ini settings given a list of lines.
Parameters
| $lines |
The list of lines that represents a php.ini.
|
| $settings |
An array where the keys are setting names and values are setting values, the values will need to be escaped before passing here.
|
Returns
Weather all the settings could be set.
|
#
|
public
static
|
windowsEnableExtension(string $extension, boolean $enabled, boolean $backupIni = true): boolean
Should only be used on windows - Edits the loaded php.ini to enable or disable extensions.
Should only be used on windows - Edits the loaded php.ini to enable or disable extensions.
Parameters
| $extension |
The extension name.
|
| $enabled |
Weather to enable or disable the extension.
|
| $backupIni |
Weather to create a backup of the php.ini before editing.
|
Returns
Weather the edit was successful.
|
#
|
public
static
|
setIniSettings(array $settings): boolean
Set php.ini settings.
Parameters
| $settings |
An array of settings, the keys are setting names and the values are setting values, the values need to be escaped before passing here.
|
Returns
Weather the setting changes were successful.
|
#
|
public
static
|
saveIni(array $lines, boolean $backup = true): boolean
Saves lines to the current php.ini.
Saves lines to the current php.ini.
Parameters
| $lines |
The lines to replace the php.ini file with.
|
| $backup |
Weather to create a backup of the php.ini before editing.
|
Returns
Weather the operation was successful.
|
#
|