WPConfigTransformer
in package
Transforms a wp-config.php file.
Table of Contents
- ANCHOR_EOF = 'EOF'
- Append to end of file
- __construct() : mixed
- Instantiates the class with a valid wp-config.php.
- add() : bool
- Adds a config to the wp-config.php file.
- exists() : bool
- Checks if a config exists in the wp-config.php file.
- get_value() : string|null
- Get the value of a config in the wp-config.php file.
- remove() : bool
- Removes a config from the wp-config.php file.
- update() : bool
- Updates an existing config in the wp-config.php file.
Constants
ANCHOR_EOF
Append to end of file
public
mixed
ANCHOR_EOF
= 'EOF'
Methods
__construct()
Instantiates the class with a valid wp-config.php.
public
__construct(string $wp_config_path) : mixed
Parameters
- $wp_config_path : string
-
Path to a wp-config.php file.
Tags
Return values
mixed —add()
Adds a config to the wp-config.php file.
public
add(string $type, string $name, string $value[, array<string|int, mixed> $options = array() ]) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
- $value : string
-
Config value.
- $options : array<string|int, mixed> = array()
-
(optional) Array of special behavior options.
Tags
Return values
bool —exists()
Checks if a config exists in the wp-config.php file.
public
exists(string $type, string $name) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
Tags
Return values
bool —get_value()
Get the value of a config in the wp-config.php file.
public
get_value(string $type, string $name) : string|null
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
Tags
Return values
string|null —remove()
Removes a config from the wp-config.php file.
public
remove(string $type, string $name) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
Return values
bool —update()
Updates an existing config in the wp-config.php file.
public
update(string $type, string $name, string $value[, array<string|int, mixed> $options = array() ]) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
- $value : string
-
Config value.
- $options : array<string|int, mixed> = array()
-
(optional) Array of special behavior options.