如何使用作曲家获得PEAR.php


How do I get PEAR.php with Composer?

我安装了 pear/archive_tar 来与 Phing 一起工作,我用 Composer 安装了它。但是,我收到此错误:

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并进行了更新,但它仍然不起作用。

这个问题的后半部分在这里分支。

我将我的composer.json设置为这个,它被修复了:

{
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.php.net"
        }
    ],
    "require": {
        "phing/phing" : "2.6.1",
        "pear-pear.php.net/pear": "*"
    }
}

像这样的本机 Composer 库不起作用,因为 Composer 不会将 pear/archive_tar 包添加到自动加载器中:

{
    "require": {
        "phing/phing" : "2.6.1",
        "rsky/pear-core-min" : "dev-master",
        "pear/archive_tar" : "1.3.11"
    }
}