Skip to content

Commit

Permalink
fix(ComponentLogServer): check if WP_ENV is defined
Browse files Browse the repository at this point in the history
Make sure we have WP_ENV (#247)
  • Loading branch information
szepeviktor authored Aug 12, 2020
1 parent 1729969 commit 04299f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/componentLogServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\');

add_action('Flynt/afterRegisterComponents', function () {
if ((WP_ENV === 'development' || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) {
if (((defined('WP_ENV') && WP_ENV === 'development') || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) {
if (isset($_GET['component']) && !empty($_GET['component'])) {
define(__NAMESPACE__ . '\COMPONENT_WHITELIST', explode(',', $_GET['component']));
}
Expand Down

3 comments on commit 04299f9

@timohubois
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since yesterday WordPress 5.5 is out and they released a new function [wp_get_environment_type()] and global system variable "WP_ENVIRONMENT_TYPE " – build into the core (https://developer.wordpress.org/reference/functions/wp_get_environment_type/).

I think this function should be implemented here and globally in flynt - insofar as environment variables are used elsewhere.

@steffenbew and @domtra: What do you think about the about?

@szepeviktor
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pixelsaft Please open an Issue!

@domtra
Copy link
Member

@domtra domtra commented on 04299f9 Aug 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #298

Please # to comment.