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

Fix scripts/* include paths #89

Merged
merged 1 commit into from
Jul 12, 2019

Conversation

LukeCarrier
Copy link
Contributor

I was confused by why my PECL-specific changes didn't seem to be doing anything until I realised that peclcmd.php doesn't specify an absolute path for pearcmd.php, instead falling back to include_path. If PEAR is installed on the system the include_path will by default include /usr/share/php, resulting in us incorrectly(?) including the installed version rather than the "raw" one in the checkout.

I also noticed that only . appears in include_path, not specifically the root directory of the checkout. This means executing e.g. ../pear/scripts/pecl.sh build from within a PECL extension directory will include the system PEAR files rather than the raw checkout.

From the commit log:

  • The scripts/ directory itself should appear in include_path if we're
    relying on it to source pearcmd from within peclcmd, else we'll
    include the system pearcmd.
  • The root directory (parent of scripts/) should always be in
    include_path on a raw checkout.

Copy link
Member

@kenguest kenguest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change dirname(FILE) to DIR please? It would make the code a bit neater and easier to read.
Thanks for your help in making PEAR better!

* The scripts/ directory itself should appear in include_path if we're
  relying on it to source pearcmd from within peclcmd, else we'll
  include the system pearcmd.
* The root directory (parent of scripts/) should always be in
  include_path on a raw checkout.
@LukeCarrier
Copy link
Contributor Author

Changes made as requested @kenguest 😁

@kenguest kenguest merged commit 114d596 into pear:master Jul 12, 2019
kenguest added a commit that referenced this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants