我正在使用 composer 来管理 2 个 symfony2 项目的依赖关系。由于这两个项目有一些共同的东西,我创建了一个(私有)公共包,这两个包都需要 composer.json
这是我的composer.json:
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"repositories": [
{
"type": "vcs",
"url": "git@git.local: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"
}
}
}
这工作正常。但我希望能够从我的 2 个项目中更改和提交公共包中的更改。
我的观点是:common bundle 不是独立的,也不能独立工作。这只是一种在我的 2 个项目之间不重复类的便捷方式。所以公共捆绑的变化总是来自我的两个项目之一。如何使我的项目中的公共包可提交?