Giter Site home page Giter Site logo

Comments (6)

veewee avatar veewee commented on August 19, 2024

Hello @lasselehtinen,

There is a possible fix that isn't released yet.
Can you try installing the master branch?

composer global require phpro/grumphp:dev-master

from grumphp.

lasselehtinen avatar lasselehtinen commented on August 19, 2024

Now I get the following error if I run grumphp on a project where guzzle is already required in composer.json. Works fine on those without though.

grumphp
PHP Fatal error:  Cannot redeclare GuzzleHttp\uri_template() (previously declared in C:\path\to\folder\vendor\guzzlehttp\guzzle\src\functions.php:18) in C:\Users\lasleh\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\functions.php on line 265

Fatal error: Cannot redeclare GuzzleHttp\uri_template() (previously declared in C:\path\to\folder\vendor\guzzlehttp\guzzle\src\functions.php:18) in C:\Users\lasleh\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\functions.php on line 265

from grumphp.

veewee avatar veewee commented on August 19, 2024

Do you have guzzle installed globally as well?
GrumPHP will try to load both the project autoloading as the system autoloading file.
Guzzle added this to the autoloader: "files": ["src/functions_include.php"]
This means that the functions are loaded twice and this triggers the fatal exception.

I don't think this is something we can do something about. If it's possible you can remove the globally installed guzzle?

from grumphp.

lasselehtinen avatar lasselehtinen commented on August 19, 2024

I had couple global packages that had guzzle as required. Namely:

https://github.com/laravel/installer
https://github.com/laravel/lumen-installer
https://github.com/vinkla/climb (require knplabs/packagist-api which in turn requires guzzle)

I removed those and now it seems to work. Downside is of course that I cannot have these packages installed at the same time. So is this more of a bug in Guzzle / Composer? I found this but I am not smart enough to figure it out.

guzzle/guzzle#676

from grumphp.

veewee avatar veewee commented on August 19, 2024

Yes, that seems to be the problem.
As Seldeak mentioned: The functions could be wrapped with function_exists() in guzzle. But this will require a change in guzzle. At the moment composer can't handle this.

from grumphp.

veewee avatar veewee commented on August 19, 2024

This fix is tagged ad 0.5.2: https://github.com/phpro/grumphp/releases/tag/v0.5.2

from grumphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.