2
votes

I am trying to install gitlist from github. In the doc, I am told to install as dependencies : some packages as phpcpd, phploc. So I installed composer and I added in the composer.json the folowing entries "phpcpd/phpcpd": "1.4.", "phploc/phploc": "1.7.". When I try o build the project with ant, I have the following message :

Your requirements could not be resolved to an installable set of packages.
     [exec] 
     [exec]   Problem 1
     [exec]     - The requested package phpcpd/phpcpd * could not be found.
     [exec]   Problem 2
     [exec]     - The requested package phploc/phploc * could not be found.

So I downloaded the phpcpd.phar and phploc.phar files but I don't know what I can do with it. Can I directly extract the files from the archive and put it in the vendor folder? By the way, why the packages are not found by composer

3
It probably can't find those packages because it doesn't have the correct repository URL for those packages. In your composer.json file, do you have something like "repositories": [ { "type": "composer", "url": "http://packages.somesite.com/" } ], THis would tell it where to find those packages. - drew010
@drew010, no I don't have any informations as such. I know I can download phpcpd running wget pear.phpunit.de/get/phpcpd.phar. This is the url I should add ? - epsilones

3 Answers

2
votes

I don't think either of those tools are composer packages yet. Did you just guess?

The github page for phpcpd does not have a composer.json, and on packagist the package cannot be found.

2
votes

Composer has a PEAR type repository you need to use to install packages from PEAR.

{
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear2.php.net"
        }
    ],
    "require": {
        "pear-pear2.php.net/PEAR2_Text_Markdown": "*",
        "pear-pear2/PEAR2_HTTP_Request": "*"
    }
}

From: http://getcomposer.org/doc/05-repositories.md#pear

0
votes

For the googlers like me ...

"repositories": [
    {
        "type": "pear",
        "url": "http://pear.phpunit.de"
    }
],
"require-dev": {
    "pear-pear.phpunit.de/phpcpd": "*",
    "pear-pear.phpunit.de/phploc": "*",
    "pear-pear.phpunit.de/PHP_CodeBrowser": "*"
}