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 PEAR.php loading for Composer custom installers #17

Merged
merged 1 commit into from
Feb 25, 2016

Conversation

greg-1-anderson
Copy link
Contributor

Do not try to call require_once on PEAR.php if it has already been loaded by the autoloader.

Motivation

The require_once of PEAR.php can cause a fatal error if this file is not available on the PHP include path. When using an autoloader, such as with Composer, this file does not need to be loaded; we can avoid needlessly stopping execution simply by testing to see if the file is already available via the autoloader.

Note that for a typical Composer application, the require line does not cause any problems, as Archive_Tar has an include line in its composer.json that allows PHP to find it when requested. However, Composer custom installers cannot benefit from this, because include and autoload files are not available in custom installers. Inside custom installers, Archive_Tar will fail if PEAR.php is not installed on the global PHP include path.

For more information, see drupal-composer/drupal-project#111

@greg-1-anderson
Copy link
Contributor Author

If you accept this PR, it would also be very helpful if you could tag a bugfix release so that this fix is available to Windows Composer custom installer users.

mrook added a commit that referenced this pull request Feb 25, 2016
Fix PEAR.php loading for Composer custom installers
@mrook mrook merged commit ad83a76 into pear:master Feb 25, 2016
@mrook
Copy link
Member

mrook commented Feb 25, 2016

Thanks for the PR, I'll tag a release.

@greg-1-anderson
Copy link
Contributor Author

Thanks so much!

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.

2 participants