Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer - Downloading git repos that don't have composer.json

I'm trying to use composer in Symfony 2.1 to pull down vendors from github libraries that are not composer aware and probably never will be.

For examples: Old Deps file:

[jQuery]
git=git://github.com/jquery/jquery.git
version=1.8.1

[Mocha]
git=https://github.com/visionmedia/mocha.git

Composer (doesn't work)

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "jquery",
            "version": "1.8.1",
            "dist": {
                "url": "git://github.com/jquery/jquery.git",
                "type": "git"
            }
        }
    }
],
"require": {
    "jquery": "1.8.1"
}
like image 547
greg Avatar asked Sep 13 '12 21:09

greg


2 Answers

If you are downloading from git, you need to specify a "source" package, not a "dist" package. Use:

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "jquery",
            "version": "1.8.1",
            "source": {
                "url": "git://github.com/jquery/jquery.git",
                "type": "git",
                "reference": "1.8.1"
            }
        }
    }
],
"require": {
    "jquery": "1.8.1"
}
like image 86
Carlos Granados Avatar answered Oct 11 '22 04:10

Carlos Granados


Another option is to useBowerfor front end package management and only use composer for what it was designed for. (PHP packages).

http://bower.io/

like image 28
greg Avatar answered Oct 11 '22 06:10

greg