Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get composer to install a non-composer package?

I am trying to get composer to download the following library from this project, however, it does not have a composer.json file in it so I'm not sure if this is possible.

{     "require" : {         "fguillot/picoFeed" : "*"     },     "repositories": [         {             "type": "vcs",             "url": "https://github.com/fguillot/picoFeed"         }     ] } 

Error:

[Composer\Repository\InvalidRepositoryException]
No valid composer.json was found in any branch or tag of https://github.com/fguillot/picoFeed, could not load a package from it.

like image 489
Xeoncross Avatar asked May 31 '13 00:05

Xeoncross


People also ask

How do I install composer PHP packages without composer?

Method 1: Using PHP-Download.com To Install PHP Packages Without Composer. This is the simplest method. The website php-download.com helps you download all the dependencies of a PHP package along with the vendor folder. Technically speaking, the site still uses Composer under the hood.

Why is composer not installing?

Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.

Where does Composer get packages from?

Composer downloads directly from the source, e.g. Packagist only knows those source and tells your composer instance where to go. It does this by downloading a bunch of json files from Packagist.org that have all the infos.


1 Answers

To include a non composer repository you need to set up a package repository. Which would give you something like:

{     "repositories": [         {             "type": "package",             "package": {                 "name": "fguillot/picoFeed",                 "version": "dev-master",                 "source": {                     "url": "https://github.com/fguillot/picoFeed",                     "type": "git",                     "reference": "origin/master"                 }             }         }     ],     "require": {         "fguillot/picoFeed": "dev-master"     } } 
like image 76
George Avatar answered Oct 04 '22 03:10

George