Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed alternative php-includepath to priority path #988

Open
6 tasks done
vol4onok opened this issue Oct 10, 2022 · 0 comments
Open
6 tasks done

Changed alternative php-includepath to priority path #988

vol4onok opened this issue Oct 10, 2022 · 0 comments

Comments

@vol4onok
Copy link

vol4onok commented Oct 10, 2022

  • PHPMD version: 2.12.0
  • PHP Version: 7.4
  • Installation type: (composer)
  • Operating System / Distribution & Version: (Linux)

Current Behavior

For now you can use php-includepath setting as an alternative path. It means that you try to find a ruleset with pathes from get_include_path() ini setting then you try to find that with <php-includepath> setting.

Expected Behavior

Proposition to use <php-includepath> as priority path instead of alternative. It means that paths from this setting should be added at the beginning of the include_path ini setting.

Steps To Reproduce:

if you use ruleset path that exist with some path from get_include_path(). it make it impossible to use that with a path <php-includepath>. Anyway you return the path from existing pathes from get_include_path().

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".

Code example.

PHPMD\RuleSetFactory::224 line
Proposition to change
$includePath = get_include_path() . PATH_SEPARATOR . $includePath;
to
$includePath .= PATH_SEPARATOR . get_include_path();.

@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants