Conversion deps -> composer.json

Discuss installing Symfony 2 here

Moderators: tiagojsag, dcobalt

Conversion deps -> composer.json

Postby mantalo » Tue May 07, 2013 2:11 pm

Hi, I'm following a tutorial about symfony 2.

This one was writed with sf 2.0.3 and i have 2.2.1. I need to install customs packages

Code: Select all
[doctrine-fixtures]
    git=http://github.com/doctrine/data-fixtures.git
   
[DoctrineFixturesBundle]
    git=http://github.com/symfony/DoctrineFixturesBundle.git
    target=/bundles/Symfony/Bundle/DoctrineFixturesBundle

[Pagerfanta]
    git=http://github.com/whiteoctober/Pagerfanta.git
    target=/pagerfanta

[WhiteOctoberPagerfantaBundle]
    git=http://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git
    target=/bundles/WhiteOctober/PagerfantaBundle

[SonataIntlBundle]
    git=http://github.com/sonata-project/SonataIntlBundle.git
    target=/bundles/Sonata/IntlBundle

[GravatarBundle]
    git=http://github.com/ornicar/GravatarBundle.git
    target=/bundles/Ornicar/GravatarBundle


How can i translate this code in the composer.json ?

Thx
mantalo
Junior Member
 
Posts: 2
Joined: Mon Oct 22, 2012 1:43 pm

Re: Conversion deps -> composer.json

Postby maastermedia » Sun May 12, 2013 11:01 am

This is very simple. Download composer.json from symfony-standard of latest 2.2, check composer.json files from each bundle you need to install and insert them in form of "name" : "branch-alias key". Like this:

Code: Select all
{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "jms/security-extra-bundle": "1.4.*",
        "jms/di-extra-bundle": "1.3.*",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "sonata-project/intl-bundle": "dev-master",
        "white-october/pagerfanta-bundle": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.2-dev"
        }
    }
}


Regards.
User avatar
maastermedia
Senior Member
 
Posts: 199
Joined: Sat Aug 14, 2010 12:51 pm
Location: Slovenia


Return to Installation and setup

Who is online

Users browsing this forum: No registered users and 5 guests