Skip to content

Commit 2380607

Browse files
committed
Update wp-config for phpdotenv 5. Fixes #76
1 parent 19024f8 commit 2380607

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"keywords": ["WordPress", "Theme", "Starter"],
55
"homepage": "https://github.com/Alecaddd/awps",
66
"license": "GPL-3.0",
7-
"version": "3.0.5",
7+
"version": "4.0.0",
88
"authors": [
99
{
1010
"name": "Alessandro Castellani",
1111
"email": "me@alecaddd.com",
12-
"homepage": "http://alecaddd.com",
12+
"homepage": "https://alecaddd.com",
1313
"role": "Developer"
1414
}
1515
],

wp-config.sample.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,30 @@
2323
*/
2424
if ( file_exists( __DIR__ . '/wp-content/themes/awps/vendor/autoload.php' ) ) :
2525
require_once __DIR__ . '/wp-content/themes/awps/vendor/autoload.php';
26-
$dotenv = Dotenv\Dotenv::create( __DIR__ );
26+
$dotenv = Dotenv\Dotenv::createImmutable( __DIR__ );
2727
$dotenv->load();
2828
endif;
2929

3030
if ( file_exists( dirname( __DIR__ ) . '/wp-content/themes/awps/vendor/autoload.php' ) ) :
3131
require_once dirname( __DIR__ ) . '/wp-content/themes/awps/vendor/autoload.php';
32-
$dotenv = Dotenv\Dotenv::create( dirname( __DIR__ ) );
32+
$dotenv = Dotenv\Dotenv::createImmutable( dirname( __DIR__ ) );
3333
$dotenv->load();
3434
endif;
3535

3636
/** MySQL settings - You can get this info from your web host
3737
* The name of the database for WordPress
3838
*/
3939

40-
define( 'DB_NAME', getenv( 'DB_NAME' ) );
40+
define( 'DB_NAME', $_ENV[ 'DB_NAME' ] );
4141

4242
/* MySQL database username */
43-
define( 'DB_USER', getenv( 'DB_USER' ) );
43+
define( 'DB_USER', $_ENV[ 'DB_USER' ] );
4444

4545
/* MySQL database password */
46-
define( 'DB_PASSWORD', getenv( 'DB_PASSWORD' ) );
46+
define( 'DB_PASSWORD', $_ENV[ 'DB_PASSWORD' ] );
4747

4848
/* MySQL hostname */
49-
define( 'DB_HOST', getenv( 'DB_HOST' ) );
49+
define( 'DB_HOST', $_ENV[ 'DB_HOST' ] );
5050

5151
/* Database Charset to use in creating database tables. */
5252
define( 'DB_CHARSET', 'utf8' );
@@ -80,7 +80,7 @@
8080
* prefix. Only numbers, letters, and underscores please!
8181
*/
8282

83-
$table_prefix = getenv( 'DB_PREFIX' );
83+
$table_prefix = $_ENV[ 'DB_PREFIX' ];
8484

8585
/*
8686
* For developers: WordPress debugging mode.
@@ -95,31 +95,31 @@
9595
* @link https://codex.wordpress.org/Debugging_in_WordPress
9696
*/
9797

98-
define( 'WP_DEBUG', getenv( 'APP_ENV' ) === 'development' ? true : false );
99-
define( 'JETPACK_DEV_DEBUG', getenv( 'APP_ENV' ) === 'development' ? true : false );
100-
define( 'WPCF7_AUTOP', getenv( 'WPCF7_AUTOP' ) );
98+
define( 'WP_DEBUG', $_ENV[ 'APP_ENV' ] === 'development' ? true : false );
99+
define( 'JETPACK_DEV_DEBUG', $_ENV[ 'APP_ENV' ] === 'development' ? true : false );
100+
define( 'WPCF7_AUTOP', $_ENV[ 'WPCF7_AUTOP' ] );
101101
define( 'FS_METHOD', 'direct' );
102102

103103
/**
104104
* Define home and site url
105105
* reduces DB calls and increase performance
106106
*/
107107

108-
define( 'WP_HOME', getenv( 'WP_HOME' ) );
109-
define( 'WP_SITEURL', getenv( 'WP_SITEURL' ) );
108+
define( 'WP_HOME', $_ENV[ 'WP_HOME' ] );
109+
define( 'WP_SITEURL', $_ENV[ 'WP_SITEURL' ] );
110110

111111
/**
112112
* Manage Post revisions and autosave
113113
*/
114114

115-
define( 'AUTOSAVE_INTERVAL', getenv( 'AUTOSAVE_INTERVAL' ) );
116-
define( 'WP_POST_REVISIONS', getenv( 'WP_POST_REVISIONS' ) );
115+
define( 'AUTOSAVE_INTERVAL', $_ENV[ 'AUTOSAVE_INTERVAL' ] );
116+
define( 'WP_POST_REVISIONS', $_ENV[ 'WP_POST_REVISIONS' ] );
117117

118118
/**
119119
* Manage Trash auto empty
120120
*/
121121

122-
define( 'EMPTY_TRASH_DAYS', getenv( 'EMPTY_TRASH_DAYS' ) );
122+
define( 'EMPTY_TRASH_DAYS', $_ENV[ 'EMPTY_TRASH_DAYS' ] );
123123

124124
/* That's all, stop editing! Happy blogging. */
125125

0 commit comments

Comments
 (0)