-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwp-config.php
More file actions
124 lines (108 loc) · 4.1 KB
/
wp-config.php
File metadata and controls
124 lines (108 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
// ===================================================
// Load database info and local development parameters
// ===================================================
require(dirname( __FILE__ ) . '/vendor/autoload.php');
require(dirname( __FILE__ ) . '/bin/populate-db.php');
$parameters = dirname( __FILE__ ) . '/app/config/parameters.yml';
$config = spyc_load_file($parameters);
$var = $config['parameters'];
if (!file_exists($parameters)) {
define( 'DB_NAME', $db_name );
define( 'DB_USER', $db_user );
define( 'DB_PASSWORD', $db_password );
define( 'DB_HOST', $db_host );
} else {
define( 'DB_NAME', $var['db_name'] );
define( 'DB_USER', $var['db_user'] );
define( 'DB_PASSWORD', $var['db_password'] );
define( 'DB_HOST', $var['db_host'] );
}
// ========================
// Custom Content Directory
// ========================
define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/wp-content' );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp-content' );
// ================================================
// You almost certainly do not want to change these
// ================================================
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
// ===========================================
// Salts, for security
// These are generated from 'composer compile'
// ===========================================
if ( file_exists( __DIR__ . '/salt.php' ) ) {
require __DIR__ . '/salt.php';
}
// ==============================================================
// Table prefix
// Change this if you have multiple installs in the same database
// ==============================================================
$table_prefix = 'wp_';
// ================================
// Language
// Leave blank for American English
// ================================
define( 'WPLANG', '' );
// =================================
// Setup S3 parameters for wp-offload
// ==================================
if (!file_exists($parameters)) {
define( 'DBI_AWS_ACCESS_KEY_ID', getenv('DBI_AWS_ACCESS_KEY_ID') );
define( 'DBI_AWS_SECRET_ACCESS_KEY', getenv('DBI_AWS_SECRET_ACCESS_KEY') );
} else {
define( 'DBI_AWS_ACCESS_KEY_ID', $var['dbi_aws_access_key_id'] );
define( 'DBI_AWS_SECRET_ACCESS_KEY', $var['dbi_aws_secret_access_key'] );
}
// ====================================================================
// Debug mode
// Enable these in app/config/paramters.yml or on heroku in config vars
// ====================================================================
if (!file_exists($parameters)) {
if (getenv('DEBUG') === 'true' || getenv('DEBUG') === true) {
$debug = true;
} else {
$debug = false;
}
define( 'WP_DEBUG', $debug );
define( 'SCRIPT_DEBUG', $debug );
} else {
define( 'WP_DEBUG', $var['debug'] );
define( 'SCRIPT_DEBUG', $var['debug'] );
}
// ========================================
// Environment
// ========================================
if (!file_exists($parameters)) {
define( 'ENVIRONMENT', getenv('ENVIRONMENT') );
} else {
define( 'ENVIRONMENT', $var['ENVIRONMENT'] );
}
// =============================================================
// Disallow File Mods - Stop users being able to install plugins
// For more information: http://bit.ly/2unkVoG
// =============================================================
if (!file_exists($parameters)) {
define( 'DISALLOW_FILE_MODS', getenv('disallow_file_mods') );
} else {
define( 'DISALLOW_FILE_MODS', $var['disallow_file_mods'] );
}
// =======================================
// WordPress SMTP server
// Enable mailing on Heroku using sendgrid
// =======================================
if (!file_exists($parameters)) {
define( 'WP_SMTP_HOST', 'smtp.sendgrid.net' );
define( 'WP_SMTP_PORT', 25 );
define( 'WP_SMTP_ENCRYPTION', 'tls' );
define( 'WP_SMTP_USER', getenv('SENDGRID_USERNAME') );
define( 'WP_SMTP_PASSWORD', getenv('SENDGRID_PASSWORD') );
}
// ===================
// Bootstrap WordPress
// ===================
if ( !defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/wp/' );
}
require_once( ABSPATH . 'wp-settings.php' );