Skip to content

This library separates WordPress configuration constants from wp-config.php to .config file.

License

Notifications You must be signed in to change notification settings

PiotrPress/wordpress-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This library separates WordPress configuration constants from wp-config.php to .config file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages