Skip to content
fritzmg edited this page Mar 25, 2016 · 15 revisions

Howto install composer?

At the moment there is only the git way available. Please use this tutorial and do not try to modify your installation, it doesn't work if you do.

git

cd /path/to/my/project/documentroot
git clone git://github.com/ContaoCommunityAlliance/Composer.git composer/vendor/contao-community-alliance/composer
cd system/modules
ln -s ../../composer/vendor/contao-community-alliance/composer/src/system/modules/\!composer .

Is there a module in the extension repository?

Yes » [composer]

Are there any planned objectives?

Yes

I am a developer and like to share my module over composer, what i need to do?

  • You need a vsc (git,svn,hg) repository available over the internet (github prefered, hook to packagist)
  • You need to add a composer.json in the root of your module repository
  • You need a packagist account
  1. Prepare your composer.json and add it to your vcs root (composer schema definitions), example at the bottom, contao specific values are under extras contao
  2. Submit package at packagist
  3. If you have your code at github you can add a packagist hook (settings -> service hooks -> packagist), then you don't need to call the update on packagist manually after you commited code

More Information (german)

example composer.json

{
    "name": "dominikzogg/contao-mysqli-socket",
    "type": "contao-module",
    "description": "add socket support to the mysqli driver in contao lts",
    "keywords": ["contao", "mysqli"],
    "license": "LGPLv3",
    "authors": [
        {
            "name": "Dominik Zogg",
            "email": "[email protected]"
        }
    ],
    "require": {
        "php": ">=5.2",
        "contao": "2.11.*",
        "contao-community-alliance/composer-plugin": "*"
    },
    "autoload": {
        "classmap": ["src/"]
    },
    "extra": {
        "contao": {
            "symlinks": {
                "src/system/drivers/DB_Mysqliwithsocketsupport.php": "system/drivers/DB_Mysqliwithsocketsupport.php"
            }
        }
    }
}

I get the following error message, while trying to install packages:

Failed to clone http://github.com/ContaoCommunityAlliance/Composer.git via git, https and http protocols, aborting
```
Try:
```
cd /path/to/my/project/documentroot
cd composer/vendor/contao-community-alliance/composer
git remote add composer [email protected]:ContaoCommunityAlliance/Composer.git
```