clearcode/wordpress-config 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

clearcode/wordpress-config

Composer 安装命令:

composer require clearcode/wordpress-config

包简介

Automagically define WordPress configuration constants from environment variables and .env file.

README 文档

README

Automagically define WordPress configuration constants from environment variables and .env file.

Installation

$ composer require clearcode/wordpress-config

Usage

Copy wp-config.php file to WordPress' root directory.

Create .env file and fill in the missing content:

DB_NAME=''
DB_USER=''
DB_PASSWORD=''
DB_HOST='localhost'
DB_CHARSET='utf8mb4'
DB_COLLATE=''
DB_PREFIX='wp_'

AUTH_KEY=''
SECURE_AUTH_KEY=''
LOGGED_IN_KEY=''
NONCE_KEY=''
AUTH_SALT=''
SECURE_AUTH_SALT=''
LOGGED_IN_SALT=''
NONCE_SALT=''

WP_VARS=''

You can also use environment variables that you have set in your .env file via a command line script, by using source it into your local shell session:

$ source .env

Instead of .env file you can use environment variables e.g. defined in you Apache server vhost configuration file:

<VirtualHost *:80>
...
	SetEnv DB_NAME ''
	SetEnv DB_USER ''
	SetEnv DB_PASSWORD ''
	SetEnv DB_HOST 'localhost'
	SetEnv DB_CHARSET 'utf8mb4'
	SetEnv DB_COLLATE ''
	SetEnv DB_PREFIX 'wp_'

	SetEnv AUTH_KEY ''
	SetEnv SECURE_AUTH_KEY ''
	SetEnv LOGGED_IN_KEY ''
	SetEnv NONCE_KEY ''
	SetEnv AUTH_SALT ''
	SetEnv SECURE_AUTH_SALT ''
	SetEnv LOGGED_IN_SALT ''
	SetEnv NONCE_SALT ''

	SetEnv WP_VARS ''
...
</VirtualHost>

You can use all WordPress configuration constants, optionally you can add your own variables, but if you want to convert them from environment variables to PHP constants, you need to add them to WP_VARS environment variable, separated by coma.

License

GPL3.0+ see LICENSE.txt and AUTHORS.txt

统计信息

  • 总下载量: 320
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2018-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固