Discussion:
How do I install http_request2 package via composer?
Tyler Collier
2014-02-18 07:17:45 UTC
Permalink
I saw that http_request2 is on github and it has a composer.json file. But
there is no description on how to add http_request2 to my project via
composer.

So I added these sections to my composer.json:

"repositories": [
{
"type": "pear",
"url": "pear.php.net"
}
],
"require": {
"pear/http_request2": "*"
},

But composer tells me:

$ sudo composer update
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for pear/http_request2 * -> satisfiable by
fpoirotte/http_request2[2.1.1-patch1].
- fpoirotte/http_request2 2.1.1-patch1 requires pear/pear_exception
dev-master -> no matching package found.

Why is pear_exception not found? Can someone add composer instructions to
the github page? https://github.com/pear/HTTP_Request2

Thanks,
Ty
Alexey Borzov
2014-02-23 10:47:07 UTC
Permalink
Hi Tyler,
Post by Tyler Collier
I saw that http_request2 is on github and it has a composer.json file. But
there is no description on how to add http_request2 to my project via
composer.
I think these are the instructions you are looking for:

https://getcomposer.org/doc/02-libraries.md#publishing-to-a-vcs
Post by Tyler Collier
"repositories": [
{
"type": "pear",
"url": "pear.php.net"
}
],
"require": {
"pear/http_request2": "*"
},
$ sudo composer update
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for pear/http_request2 * -> satisfiable by
fpoirotte/http_request2[2.1.1-patch1].
- fpoirotte/http_request2 2.1.1-patch1 requires pear/pear_exception
dev-master -> no matching package found.
Looks like composer does some black magic here and uses a fork of HTTP_Request2
rather than an official repository.

I didn't yet bother to register HTTP_Request2 on packagist, maybe this is the case.
Post by Tyler Collier
Why is pear_exception not found? Can someone add composer instructions to
the github page? https://github.com/pear/HTTP_Request2
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tyler Collier
2014-02-23 18:27:48 UTC
Permalink
Hi Alexey,

Would you be willing to add it to Packagist ? If not, I could give it a
shot. I've never done it before.

What's odd is http_request2 is already on packagist, as mentioned in the
output I pasted. It's at
https://packagist.org/packages/fpoirotte/http_request2. And pear_exception
is too at https://packagist.org/packages/pear/pear_exception. It's
complaining about not having dev-master (which is what's referenced at
https://github.com/fpoirotte/HTTP_Request2/blob/trunk/composer.json), but
isn't that dev-master I see right there on the packagist page for
pear_exception already?
Post by Alexey Borzov
Hi Tyler,
Post by Tyler Collier
I saw that http_request2 is on github and it has a composer.json file. But
there is no description on how to add http_request2 to my project via
composer.
https://getcomposer.org/doc/02-libraries.md#publishing-to-a-vcs
Post by Tyler Collier
"repositories": [
{
"type": "pear",
"url": "pear.php.net"
}
],
"require": {
"pear/http_request2": "*"
},
$ sudo composer update
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for pear/http_request2 * -> satisfiable by
fpoirotte/http_request2[2.1.1-patch1].
- fpoirotte/http_request2 2.1.1-patch1 requires pear/pear_exception
dev-master -> no matching package found.
Looks like composer does some black magic here and uses a fork of
HTTP_Request2 rather than an official repository.
I didn't yet bother to register HTTP_Request2 on packagist, maybe this is the case.
Why is pear_exception not found? Can someone add composer instructions to
Post by Tyler Collier
the github page? https://github.com/pear/HTTP_Request2
Loading...