How do I get PEAR.php with Composer?

那年仲夏 提交于 2019-12-06 12:21:50

问题


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

I added the PEAR repository to Composer and updated, but it still did not work.

The second half of this question branched off here.


回答1:


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": "*"
    }
}

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"
    }
}


来源:https://stackoverflow.com/questions/19592858/how-do-i-get-pear-php-with-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!