Issue
I'm converting an old project (with old dependencies) to manage it's dependencies using composer. The site uses PEAR's Text_Password. I read that it is possible to install dependencies with composer adding (something like) the following to composer.json:
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"require": {
...
"pear-pear/Text_Password": "*"
},
..but I get the error:
$ 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
- The requested package pear-pear/text_password could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Is it possible to install PEAR libraries with Composer? I notice on packagist there is a collection of PEAR libraries but I couldn't see Text_Password - https://packagist.org/packages/pear/
There is also a github repo for Text_Password but I thought maybe installing direct from PEAR was better? - https://github.com/pear/Text_Password
Anyway how can I install this package with composer?
Solution
Here you go:
{
"type": "project",
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"require": {
"pear-pear.php.net/Text_Password": "*"
}
}
Note: The PEAR repository has been removed from Composer 2.0
Answered By - Jens A. Koch
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.