Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 1.02 KB

readme.md

File metadata and controls

48 lines (33 loc) · 1.02 KB

WordPress Config

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.

License

MIT