我正在转换一个旧项目(具有旧依赖项),以使用composer来管理它的依赖项。该网站使用PEAR的Text_Password。我读到composer可以在composer.json中添加(类似于)以下内容来安装依赖项:
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"require": {
...
"pear-pear/Text_Password": "*"
},
但我得到了错误:
$ 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.
是否可以使用Composer安装PEAR库?我注意到packagist上有一个PEAR库集合,但我看不到Text_Password-https://packagist.org/packages/pear/
还有一个用于Text_Password的github repo,但我认为直接从PEAR安装可能更好?-https://github.com/pear/Text_Password
无论如何,我怎样才能用composer安装这个包?
开始:
{
"type": "project",
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"require": {
"pear-pear.php.net/Text_Password": "*"
}
}
注意:PEAR存储库已从Composer 2.0 中删除