Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Composer to get github repo with Kohana fails: "requested package could not be found"

I would like to use Composer to include the php readability git project. This is my composer.json file:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "php-readability/php-readability",
                "version": "master",
                "source": {
                    "url": "https://github.com/feelinglucky/php-readability.git",
                    "type": "git",
                    "reference": "branches/master"
                }
            }
        }
    ],
    "require": {
        "php-readability/php-readability": "master"
    }
}

The error I get is:

Problem 1
 - The requested package php-readability/php-readability master could not be found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
 problems.

This is my first time using Composer so it is likely my config is wrong!

like image 458
xylar Avatar asked Mar 18 '13 22:03

xylar


1 Answers

The php-readability project has not tags (so it's not stable in composer terms). By default only stable packages are taken into account.

To indicate you want to install a dev version of a package define its version as "dev-master" or "*@dev".

Also, you gave a wrong reference in the repository definition. Here's a working composer.json:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "php-readability/php-readability",
                "version": "master",
                "source": {
                    "url": "https://github.com/feelinglucky/php-readability.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],
    "require": {
        "php-readability/php-readability": "dev-master"
    }
}
like image 188
Jakub Zalas Avatar answered Sep 29 '22 07:09

Jakub Zalas