WP-CLI + Sage = Warning messages

Hi there,

I’m using WP-CLI with Sage, and I am getting the following warnings in relation to the WP_ENV statement in wp-config.php:

18:13 $ [example command] wp plugin install --activate pluginxyz

PHP Notice:  Use of undefined constant WP_ENV - assumed 'WP_ENV' in phar:///usr/local/bin/wp/php/wp-cli.php(23) : eval()'d code on line 44
PHP Notice:  Use of undefined constant development - assumed 'development' in phar:///usr/local/bin/wp/php/wp-cli.php(23) : eval()'d code on line 44
Installing XYZPlugin for WordPress (3.3.5)

I have the following in wp-config.php:

define(WP_ENV, development);

It’s not stopping me from using WP-CLI but it would be cool to stop the warnings from showing up all the time :+1: :grin:

Did you place it above this line?

/* That's all, stop editing! Happy blogging. */

I don’t have a non-Bedrock environment ready right now to quickly test

I just moved the line of code above that comment you mentioned, and I am getting a slightly different notice:

PHP Notice:  Use of undefined constant WP_ENV - assumed 'WP_ENV' in phar:///usr/local/bin/wp/php/wp-cli.php(23) : eval()'d code on line 74
PHP Notice:  Use of undefined constant development - assumed 'development' in phar:///usr/local/bin/wp/php/wp-cli.php(23) : eval()'d code on line 74

BTW I can confirm this message appears after upgrading from PHP 5.3 to PHP 5.5 as it’s just started showing up after upgrading another server - it may not be Roots / Sage related.