-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD: WP constants in .env & application.php #680
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,20 @@ WP_SITEURL="${WP_HOME}/wp" | |
# Specify optional debug.log path | ||
# WP_DEBUG_LOG='/path/to/debug.log' | ||
|
||
# Configuring development mode | ||
# Values: core, plugin, theme, all (default) | ||
# See: https://make.wordpress.org/core/2023/07/14/configuring-development-mode-in-6-3/ | ||
# WP_DEVELOPMENT_MODE=core | ||
|
||
## WP OPTIONS | ||
WP_CACHE=true | ||
WP_POST_REVISIONS=5 | ||
WP_CONCATENATE_SCRIPTS=false | ||
WP_COMPRESS_SCRIPTS=true | ||
WP_COMPRESS_CSS=true | ||
WP_ENFORCE_GZIP=true | ||
DISABLE_WP_CRON=false | ||
|
||
Comment on lines
+20
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably don't need any of this here if we have sensible production-ready defaults. |
||
# Generate your keys here: https://roots.io/salts.html | ||
AUTH_KEY='generateme' | ||
SECURE_AUTH_KEY='generateme' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,39 @@ | |
// Limit the number of post revisions | ||
Config::define('WP_POST_REVISIONS', env('WP_POST_REVISIONS') ?? true); | ||
|
||
// Autosave | ||
Config::define('AUTOSAVE_INTERVAL', env('WP_AUTOSAVE_INTERVAL') ?? 300); | ||
|
||
// Empty trash | ||
Config::define('EMPTY_TRASH_DAYS', env('WP_EMPTY_TRASH_DAYS') ?? 120); | ||
|
||
// Memory limit | ||
Config::define('WP_MEMORY_LIMIT', env('WP_MEMORY_LIMIT') ?? '128M'); | ||
|
||
// Max execution time (can't overide server settings) | ||
Config::define('WP_MAX_EXECUTION_TIME', env('WP_MAX_EXECUTION_TIME') ?? '300'); | ||
|
||
// Max upload size (can't overide server settings) | ||
Config::define('WP_MAX_UPLOAD_SIZE', env('WP_MAX_UPLOAD_SIZE') ?? '128M'); | ||
|
||
// Max post size (can't overide server settings) | ||
Config::define('WP_MAX_POST_SIZE', env('WP_MAX_POST_SIZE') ?? '128M'); | ||
|
||
// Activate cache | ||
Config::define( 'WP_CACHE', env('WP_CACHE') ?? false ); | ||
|
||
// Concatenate scripts | ||
Config::define( 'CONCATENATE_SCRIPTS', env('WP_CONCATENATE_SCRIPTS') ?? false ); | ||
|
||
// Compress scripts | ||
Config::define( 'COMPRESS_SCRIPTS', env('WP_COMPRESS_SCRIPTS') ?? false ); | ||
|
||
// Compress CSS | ||
Config::define( 'COMPRESS_CSS', env('WP_COMPRESS_CSS') ?? false ); | ||
|
||
// Force GZIP compression (default is deflate) | ||
Config::define( 'ENFORCE_GZIP', env('WP_ENFORCE_GZIP') ?? 'deflate' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is interesting, but I would rather this not be handled by the application. This is something that should be handled by the server. |
||
|
||
/** | ||
* Debugging Settings | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
use function Env\env; | ||
|
||
Config::define('SAVEQUERIES', true); | ||
Config::define('WP_DEVELOPMENT_MODE', env('WP_DEVELOPMENT_MODE') ?? 'all'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have my reservations about this. |
||
Config::define('WP_DEBUG', true); | ||
Config::define('WP_DEBUG_DISPLAY', true); | ||
Config::define('WP_DEBUG_LOG', env('WP_DEBUG_LOG') ?? true); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's get rid of this file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* Configuration overrides for WP_ENV === 'local' | ||
*/ | ||
|
||
use Roots\WPConfig\Config; | ||
use function Env\env; | ||
|
||
Config::define('SAVEQUERIES', true); | ||
Config::define('WP_DEVELOPMENT_MODE', env('WP_DEVELOPMENT_MODE') ?? 'all'); | ||
Config::define('WP_DEBUG', true); | ||
Config::define('WP_DEBUG_DISPLAY', true); | ||
Config::define('WP_DEBUG_LOG', env('WP_DEBUG_LOG') ?? true); | ||
Config::define('WP_DISABLE_FATAL_ERROR_HANDLER', true); | ||
Config::define('SCRIPT_DEBUG', true); | ||
Config::define('DISALLOW_INDEXING', true); | ||
|
||
ini_set('display_errors', '1'); | ||
|
||
// Enable plugin and theme updates and installation from the admin | ||
Config::define('DISALLOW_FILE_MODS', false); | ||
|
||
// Disable the plugin and theme file editor in the admin | ||
Config::define('DISALLOW_FILE_EDIT', false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting that default is an empty string, not
all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, my bad, I've coded it too fast! ^^'