1

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.

Community
  • 1
  • 1
NobleUplift
  • 5,631
  • 8
  • 45
  • 87
  • I changed this question for anyone else who might be able to answer. – NobleUplift Oct 28 '13 at 18:00
  • Did you run `composer update`, and what was it's output? – Sven Oct 28 '13 at 22:09
  • I think it's a problem with the phing/phing package in Composer, not updating Composer itself. The update runs smoothly. – NobleUplift Oct 28 '13 at 22:29
  • I'm splitting my question into two questions and an answer, because I discovered how to get PEAR.php, but Phing is not working. – NobleUplift Oct 29 '13 at 14:52
  • You probably don't need `PEAR.php`, as this is the component installing libraries into pear. You need `pear/archive_tar` installed and working, and this exists also as a genuine Composer package, so there is no need to define a PEAR repository. So the last question is: How to tell Phing to locate Archive_Tar? And that part of the question has no current info about what you did. You removed it. – Sven Oct 29 '13 at 19:36

1 Answers1

-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"
    }
}
NobleUplift
  • 5,631
  • 8
  • 45
  • 87
  • This isn't really THE answer, is it? I got the impression that this still does not work. And I wonder why you require "pear/archive_tar" in the one example, but not in the other one. – Sven Oct 29 '13 at 19:38
  • `"pear-pear.php.net/pear": "*"` downloads a version of `archive_tar`. Otherwise, it _might_ work. I won't know until my other question is resolved. I'll add a link to this question for anyone else. – NobleUplift Oct 29 '13 at 20:31
  • I edited my question to reflect what works and what doesn't work. – NobleUplift Oct 29 '13 at 21:09