{"repo":"wp-cli/wp-config-transformer","free":true,"listed":false,"github":"https://github.com/wp-cli/wp-config-transformer","clone":"git clone https://github.com/wp-cli/wp-config-transformer.git","description":"Programmatically edit a wp-config.php file","language":"PHP","stars":85,"topics":["wp-cli","config","transformer","wordpress","hacktoberfest"],"license":"MIT","category":"self-hosted-apps","readme_excerpt":"WP Config Transformer Programmatically edit a wp-config.php file. Quick links: Using &#124; Options &#124; How it works &#124; Testing Using Instantiate Edit constants Edit variables Check for existence Options Special behaviors when adding or updating configs are available using the options array. Normalization In contrast to the \"edit in place\" strategy above, there is the option to normalize the output during a config update and effectively replace the existing syntax with output that adheres to WP Coding Standards. Let's reconsider a poorly-formatted example: This time running: Now we will get an output of: Nice! Raw format Suppose you want to change your ABSPATH config (gasp!) . To do that, we can run: The raw option means that instead of placing the value inside the config as a string \"dirname( FILE ) . '/somewhere/else/'\" it will become unquoted (and executable) syntax dirname( FILE ) . '/somewhere/else/' . Anchor string The anchor string is the piece of text that additions will be anchored to. Anchor placement By default, new configs will be placed before the anchor string. Anchor separator By default, the separator between a new config and its anchor string is an EOL (\"\\n\" on nix and \"\\r\\n\" on Windows). Add if missing By default, when attempting to update a config that doesn't exist, one will be added. This behavior can be overridden by specifying the add option and setting it to false . If the constant FOO exists, it will be updated in-place. And if not, the update ","default_branch":null,"files":null,"tree":[],"storefront":"/r/wp-cli","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wp-cli/wp-config-transformer/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}