如何通过Composer获取PEAR.php? [英] How do I get PEAR.php with Composer?
本文介绍了如何通过Composer获取PEAR.php?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我安装了pear / archive_tar以与Phing一起使用,而Phing是与Composer一起安装的。但是,我收到此错误:
I installed pear/archive_tar to work with Phing, which I installed with Composer. However, I received this error:
BUILD FAILED
exception 'BuildException' with message 'Error reading project file [wrapped: You must have installed the PEAR Archive_Tar class in order to use TarTask.]' in vendor/phing/phing/classes/phing/parser/ProjectConfigurator.php:197
我添加了 PEAR存储库提交给Composer并进行了更新,但仍然无法正常工作。
I added the PEAR repository to Composer and updated, but it still did not work.
The second half of this question branched off here.
推荐答案
我将composer.json设置为此,并已修复:
I set my composer.json to this, and it was fixed:
{
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"require": {
"phing/phing" : "2.6.1",
"pear-pear.php.net/pear": "*"
}
}
诸如此类的本地Composer库不起作用,因为Composer不会将pear / archive_tar包添加到自动加载器中:
Native Composer libraries such as this do not work, because Composer does not add the pear/archive_tar package to the autoloader:
{
"require": {
"phing/phing" : "2.6.1",
"rsky/pear-core-min" : "dev-master",
"pear/archive_tar" : "1.3.11"
}
}
这篇关于如何通过Composer获取PEAR.php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文