- Update .env management

This commit is contained in:
Vincent BRIDIER 2020-06-19 15:37:35 +02:00
parent d64039a0e7
commit 2f8a613ab8

View file

@ -2,6 +2,14 @@
require_once 'vendor/autoload.php';
Dotenv\Dotenv::createImmutable(__DIR__)->load();
// Custom Dotenv Boolean Support
if (! function_exists('evalBool')) {
function evalBool($value)
{
return (strcasecmp($value, 'true') ? false : true);
}
}
/**
* The base configuration for WordPress
*
@ -140,9 +148,9 @@ define( 'SMTP_PORT', getenv('SMTP_PORT') );
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define( 'SCRIPT_DEBUG', (bool) getenv('SCRIPT_DEBUG') );
define('WP_DEBUG', (bool) getenv('WP_DEBUG'));
define('WP_DEBUG_DISPLAY', (bool) getenv('WP_DEBUG_DISPLAY'));
define( 'SCRIPT_DEBUG', evalBool(getenv('SCRIPT_DEBUG')) );
define('WP_DEBUG', evalBool(getenv('WP_DEBUG')));
define('WP_DEBUG_DISPLAY', evalBool(getenv('WP_DEBUG_DISPLAY')));
/* That's all, stop editing! Happy publishing. */
@ -168,7 +176,7 @@ define('PLATEFORME_90',90);
define('PLATEFORME_91',91);
define('PLATEFORME_92',92);
#define('WP_HTTP_BLOCK_EXTERNAL', (bool) getenv('WP_HTTP_BLOCK_EXTERNAL'));
define('WP_HTTP_BLOCK_EXTERNAL', evalBool(getenv('WP_HTTP_BLOCK_EXTERNAL')));
/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );