Skip to content

Replace PrestissimoFileFetcher with Guzzle #87

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

Closed
wants to merge 2 commits into from

Conversation

webflo
Copy link
Member

@webflo webflo commented Jul 4, 2018

I was not able to resolve the error logging in #73. Therefore i tried to re-implement the feature on Guzzle again.

We had Guzzle some time about, but remove it because of dependency issues.

@webflo webflo requested a review from greg-1-anderson July 4, 2018 12:29
@webflo
Copy link
Member Author

webflo commented Jul 4, 2018

Its this error again

Generating autoload files

Fatal error: Uncaught Error: Call to undefined function GuzzleHttp\choose_handler() in /Users/fweber/Sites/app3/vendor/guzzlehttp/guzzle/src/HandlerStack.php:40
Stack trace:
#0 /Users/fweber/Sites/app3/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create()
#1 /Users/fweber/Sites/app3/vendor/drupal-composer/drupal-scaffold/src/GuzzleFileFetcher.php(36): GuzzleHttp\Client->__construct()
#2 /Users/fweber/Sites/app3/vendor/drupal-composer/drupal-scaffold/src/Handler.php(166): DrupalComposer\DrupalScaffold\GuzzleFileFetcher->fetch('8.5.4', '/Users/fweber/S...', true)
#3 /Users/fweber/Sites/app3/vendor/drupal-composer/drupal-scaffold/src/Handler.php(138): DrupalComposer\DrupalScaffold\Handler->downloadScaffold()
#4 /Users/fweber/Sites/app3/vendor/drupal-composer/drupal-scaffold/src/Plugin.php(83): DrupalComposer\DrupalScaffold\Handler->onPostCmdEvent(Object(Composer\Script\Event))
#5 [internal function]: DrupalComposer\DrupalScaffold\Plugin->postCmd(Object(Composer\Script\Event))
#6 phar:///opt/boxen/php in /Users/fweber/Sites/app3/vendor/guzzlehttp/guzzle/src/HandlerStack.php on line 40

Composer builds the autloader, but only PSR-0/4 autoloads, not file based.

@greg-1-anderson
Copy link
Collaborator

Yeah I have a solution for this - where did I put it? One moment.

@greg-1-anderson
Copy link
Collaborator

The issue is that Composer does not load the files section of Composer plugins' autoloader. I just need to remember which Composer plugin I was using Guzzle in. I think it was in some Composer scripts, which has the same issue.

@greg-1-anderson
Copy link
Collaborator

@webflo
Copy link
Member Author

webflo commented Jul 4, 2018

Maybe we should defer the download operation until the autoloader has been build?

@greg-1-anderson
Copy link
Collaborator

It will work just fine if you include the Guzzle files that are needed; however, Guzzle could easily decide to chose to add more files to the include section or rename the files, etc., and these would not be breaking changes per SemVer. It would be really grand if Guzzle would just move these functions into static class methods, as that would work from Composer plugins.

@greg-1-anderson
Copy link
Collaborator

I have not tried just manually including the autoload.php file. I'm not sure if this would or would not cause problems with Composer. The stated reason that Composer does not include the include files from the autoloader for plugins is that they cannot know if any given include file is idempotent. That is not a concern for Guzzle.

@webflo
Copy link
Member Author

webflo commented Jul 4, 2018

We should not pursue this longer. The fix in #88 is much smaller.

@webflo webflo closed this Jul 4, 2018
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