Closed saas786 closed 2 years ago
Hi @saas786 I think the best way to do this wouldbe to define this in a PHP file, because expressions are not supported by cache.
As you can see documente here: https://github.com/wecodemore/wpstarter/blob/version-3/docs/03-WordPress-Integration.md#environment-specific-files you can have a PHP file loader per environment.
So, for example, if you have a WP_ENV
environment variable that is set to my_env
, like:
WP_ENV=my_env
then you can have a my_env.php
file loaded, and in that file you could do:
define('WP_SENTRY_ERROR_TYPES', E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_DEPRECATED);
Note that you can also use the WordPress' WP_ENVIRONMENT_TYPE
env variable instead of WP_ENV
, but that will affect the result of the wp_get_environment_type()
function
@gmazzap Awesome, I was trying to do it with single env
file, so lost focus :)
It works with development.php
, thanks a bunch.
I am trying to add
define( 'WP_SENTRY_ERROR_TYPES', E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_DEPRECATED );
Ref: https://github.com/stayallive/wp-sentry/blob/e697fe5b28ddc014c358e9c0738d95e597e274af/readme.txt#L39
to my
.env.development
as (notice I have removed spaces, as it fails with spaces).But it turn it into string
.env.cached.php
:I had a look at: https://github.com/wecodemore/wpstarter/blob/42d32face1fc58a77e0513574a9ebaf6b848a807/src/Env/Filters.php#L30
But I don't see a
Type
which I could use for my need.So either there is a way to add such constant? or can you please add such
Type
so I can add such constants.