diff --git a/config/php/fpm/standardebooks.org.conf b/config/php/fpm/standardebooks.org.conf index dcc06c65..e7867cec 100644 --- a/config/php/fpm/standardebooks.org.conf +++ b/config/php/fpm/standardebooks.org.conf @@ -16,5 +16,3 @@ slowlog = /var/log/local/php-fpm-slow.log catch_workers_output = yes php_admin_value[include_path] = /standardebooks.org/web/lib - -env[SITE_STATUS] = "live" diff --git a/config/php/fpm/standardebooks.org.ini b/config/php/fpm/standardebooks.org.ini index b2ca4241..0e0de0e3 100644 --- a/config/php/fpm/standardebooks.org.ini +++ b/config/php/fpm/standardebooks.org.ini @@ -9,6 +9,7 @@ max_execution_time = 120 allow_url_fopen = false allow_url_include = false expose_php = off +site_status = "live" [Date] date.timezone = Etc/UTC diff --git a/config/php/fpm/standardebooks.test.conf b/config/php/fpm/standardebooks.test.conf index a80d6eb4..230c05f3 100644 --- a/config/php/fpm/standardebooks.test.conf +++ b/config/php/fpm/standardebooks.test.conf @@ -16,5 +16,3 @@ slowlog = /var/log/local/php-fpm-slow.log catch_workers_output = yes php_admin_value[include_path] = /standardebooks.org/web/lib:/standardebooks.org/web/vendor - -env[SITE_STATUS] = "dev" diff --git a/config/php/fpm/standardebooks.test.ini b/config/php/fpm/standardebooks.test.ini new file mode 100644 index 00000000..0e0de0e3 --- /dev/null +++ b/config/php/fpm/standardebooks.test.ini @@ -0,0 +1,18 @@ +error_log = "/var/log/local/php-error.log" +display_errors = Off +display_startup_errors = Off +html_errors = Off +log_errors = On +short_open_tag = On +error_reporting = E_ALL +max_execution_time = 120 +allow_url_fopen = false +allow_url_include = false +expose_php = off +site_status = "live" + +[Date] +date.timezone = Etc/UTC + +[opcache] +opcache.validate_timestamps = off diff --git a/lib/Constants.php b/lib/Constants.php index 1945d9ed..f5624be6 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -6,7 +6,8 @@ use function Safe\strtotime; const SITE_STATUS_LIVE = 'live'; const SITE_STATUS_DEV = 'dev'; -define('SITE_STATUS', getenv('SITE_STATUS') ?: SITE_STATUS_DEV); // Set in the PHP FPM pool configuration. Have to use define() and not const so we can use a function. + +define('SITE_STATUS', get_cfg_var('site_status') ?: SITE_STATUS_DEV); // Set in the PHP INI configuration for both CLI and FPM. Have to use define() and not const so we can use a function. // No trailing slash on any of the below constants. if(SITE_STATUS == SITE_STATUS_LIVE){