2013-04-26 2 views
4

나는 2 개의 symfony2 프로젝트의 의존성을 관리하기 위해 작곡가를 사용하고 있습니다.작곡가 depency를 커밋 할 수있게 만드는 방법?

{ 
    "name": "symfony/framework-standard-edition", 
    "description": "The \"Symfony Standard Edition\" distribution", 
    "repositories": [ 
    { 
     "type": "vcs", 
     "url": "[email protected]:commonbundle.git" 
    } 
    ], 
    "require": { 
    "php": ">=5.3.3", 
    "symfony/symfony": "2.2.*", 
    "doctrine/orm": ">=2.2,<3.0,>=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.*", 
    "kriswallsmith/assetic": "1.1.*@dev", 

    "doctrine/common": "2.4.*@dev", 
    "doctrine/data-fixtures": "dev-master", 
    "doctrine/doctrine-fixtures-bundle": "dev-master", 
    "gmp/common-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" 
    ] 
    }, 
    "extra": { 
    "symfony-app-dir": "app", 
    "symfony-web-dir": "web", 
    "symfony-assets-install": "symlink", 
    "branch-alias": { 
     "dev-master": "2.2-dev" 
    } 
    } 
} 

이 잘 작동 :이 두 프로젝트는 몇 가지 일반적인 물건을 , 나는 모두 composer.json

여기 내 composer.json이 요구된다 (개인) 일반 번들을 만들었습니다. 그러나 나는 두 개의 프로젝트에서 공통 번들의 변경 사항을 변경하고 적용 할 수 있기를 원합니다.

요점은 공통 번들이 독립적이지 않으며 독립 실행 형이 아니라는 것입니다. 그것은 내 2 개의 프로젝트 사이에서 클래스를 복제하지 않는 편리한 방법입니다. 공통 번들의 변경은 항상 내 2 개의 프로젝트 중 하나에서 발생합니다. 공통 번들을 내 프로젝트에서 커밋 할 수있게하려면 어떻게해야합니까?

+1

주 프로젝트 중 하나에서 composer install을 실행할 때 --prefer-source를 사용하면 공통 번들의 공급 업체 디렉토리에 CD를 넣고 변경 한 다음 다시 커밋해야합니다. – catchamonkey

+1

@catchamonkey이 주석은 대답이어야합니다. – Hailwood

+0

고마워요. @Hailwood, 네가 맞아. – catchamonkey

답변

0

commonbundle repo를 git submodule로 각 프로젝트에 추가 할 수 있습니까?

cd /path/to/Proj1 
git submodule add path/to/commonbundle commonbundle 
git commit -m "added submodule" 
[repeat for Proj 2] 
2

당신은 작곡가가, 당신의 주요 프로젝트 중 하나에 설치하면 --prefer 소스를 할 경우 다음, 당신의 공통 번들의 공급 업체 디렉토리에 CD 할 수 변경하고 다시 커밋한다 실행하면 그것에.

관련 문제