piotrpress / wordpress-config
This library separates WordPress configuration constants from wp-config.php to .config file.
Installs: 384
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
pkg:composer/piotrpress/wordpress-config
Requires
- php: >=7.4
- piotrpress/initer: ^1.0
- piotrpress/remoter: ^1.0
This package is auto-updated.
Last update: 2025-10-04 23:24:06 UTC
README
This library separates WordPress configuration constants from wp-config.php to .config file.
Installation via composer.json file
{
"require": {
"piotrpress/wordpress-config": "^3.0"
},
"scripts": {
"post-update-cmd": "php -r \"copy('vendor/piotrpress/wordpress-config/res/wp-config.php', 'wp-config.php');\""
}
}
NOTE: if .config file doesn't exists, it'll be created automatically.
Usage
Fill in the missing configuration in .config file.
Example
DB_NAME=wordpress DB_USER="${USER}" DB_PASSWORD="${PASS}" DB_HOST=localhost WP_DEBUG=true WP_HOME="https://${SERVER_NAME}" WP_CONTENT_DIR="${DOCUMENT_ROOT}/wp-content"
NOTE: use ${...} syntax to return environment or server variable.
Resources
Check out example implementation in the piotrpress/wordpress package.
Requirements
PHP >= 7.4 version.