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
Operating System / Distribution & Version: Ubuntu in Docker
Current Behavior
Executing vendor/bin/phpmd.phar does do nothing (vendor/composer-phar/phpmd/phpmd.phar works as expected)
Expected Behavior
Executing the phpmd.phar via the generated composer wrapper works
Steps To Reproduce:
composer req composer-phar/phpmd
vendor/bin/phpmd.phar <dir> ansi codestyle
Details
A change introduced 15 years ago, which i don't know if its still relevant, prohibits the execution of PHP Mess Detector when included by other Script.
The phpmd.phar checks if the executed script equals the actual phar file (itself) and does nothing, if it was included.
I am not aware of any reason or requirement to perform this check. Maybe there actually isn't any. I would be glad if the check could be removed, so the composer-phar project can move on and provide the phpmd.pahr to anyone via composer.
The technical details are:
Composer install the package
The package defines phpmd.phar as bin
Composer creates a wrapper script in vendor/bin/phpmd.phar whith return include __DIR__ . '/..'.'/composer-phar/phpmd/phpmd.phar';
When included, the condition isset($argv) && realpath($argv[0]) === __FILE__ in phpmd.phar/.phar/stub.php evaluates to false.
__HALT_COMPILER(); is the next and inherently last instruction processed by PHP
YES, i am aware of PHIVE. If you don't mind I would like to exclude PHIVE and the whole "just curl/wget the phar" from this discussion.
Checks before submitting
Be sure that there isn't already an issue about this. See: Issues list
Be sure that there isn't already a pull request about this. See: Pull requests
I have added every step to reproduce the bug.
If possible I added relevant code examples.
This issue is about 1 bug and nothing more.
The issue has a descriptive title. For example: "JSON rendering failed on Windows for filenames with space".
The text was updated successfully, but these errors were encountered:
Current Behavior
Executing vendor/bin/phpmd.phar does do nothing (vendor/composer-phar/phpmd/phpmd.phar works as expected)
Expected Behavior
Executing the phpmd.phar via the generated composer wrapper works
Steps To Reproduce:
composer req composer-phar/phpmd
vendor/bin/phpmd.phar <dir> ansi codestyle
Details
A change introduced 15 years ago, which i don't know if its still relevant, prohibits the execution of PHP Mess Detector when included by other Script.
The phpmd.phar checks if the executed script equals the actual phar file (itself) and does nothing, if it was included.
I am not aware of any reason or requirement to perform this check. Maybe there actually isn't any. I would be glad if the check could be removed, so the composer-phar project can move on and provide the phpmd.pahr to anyone via composer.
The technical details are:
phpmd.phar
asbin
vendor/bin/phpmd.phar
whithreturn include __DIR__ . '/..'.'/composer-phar/phpmd/phpmd.phar';
isset($argv) && realpath($argv[0]) === __FILE__
inphpmd.phar/.phar/stub.php
evaluates to false.__HALT_COMPILER();
is the next and inherently last instruction processed by PHPYES, i am aware of PHIVE. If you don't mind I would like to exclude PHIVE and the whole "just
curl
/wget
the phar" from this discussion.Checks before submitting
The text was updated successfully, but these errors were encountered: