You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Defining constant with __FILE__ in name breaks execution #5332
Defining a constant in wp-config.php that includes __FILE__ in the name of the constant, causes wp-cli to fail with this error message:
Parse error: syntax error, unexpected 'var' (T_VAR) in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1197) : eval()'d code on line 66
Using latest v2.4.0 phar executable.
Describe how other contributors can replicate this bug
Add this line to wp-config.php
define( 'WP_CONFIG__FILE__', __FILE__ );
Run wp
See the above error, command fails
Describe what you expect as the correct outcome
I would expect the wp command list to display.
Let us know what environment you are running this on
Activity
schlessera commentedon Feb 5, 2020
The code in
wp-cli/php/utils.php
Lines 614 to 624 in d68399b
We should use the code from wp-cli/eval-command#44 and provide it as an improved centralized helper here, and then make
eval-filereuse that helper.eval-filetowp-cli/wp-cliwp-cli/wp-clirelease: UseUtils/replace_path_consts()ineval-filewp-cli/wp-clirelease: Bump version requirement ofwp-cli/wp-cliinwp-cli/eval-commandschlessera commentedon May 12, 2021
This should be resolved with latest
masterand fixed in upcoming v2.5.0 release.