nategood / httpful

A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.
MIT License
1.74k stars 298 forks source link

Composer autoload doesn't work #275

Open llamafilm opened 6 years ago

llamafilm commented 6 years ago

I've never used Composer, so maybe I am doing something wrong, but this doesn't seem to work. I added your info to composer.json, then ran php composer.phar install and it gave a success message. But using Httpful\Request fails with Fatal error: Class 'Httpful\Request' not found

If I require('vendor/nategood/httpful/bootstrap.php'); in my code then it works.

KarimGeiger commented 5 years ago

You should require the composer autoloader at vendor/autoload.php. That's the way composer works: You require this file once and then composer allows you to use all the dependencies without needing to require anything.

KarimGeiger commented 5 years ago

And I just noticed that this issue is 4 months old. Well... at least now you know... :D