我有一個Symfony 2.1項目,通過作曲家安裝了附加的軟件包。我想將其部署到我的生產服務器,但我想知道是否需要更改composer.json
文件中的任何內容。以下是我當前的文件內容:我的composer.json文件在生產環境中應該如何顯示?
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.1.1",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.0.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.1.*",
"symfony/monolog-bundle": "2.1.*",
"sensio/distribution-bundle": "2.1.*",
"sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"friendsofsymfony/user-bundle": "*",
"knplabs/knp-paginator-bundle": "dev-master",
"ornicar/gravatar-bundle": "dev-master",
"liip/url-auto-converter-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": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}
我應該更改minimum-stability
設置嗎?
我是否應該將每個要求修正爲單個版本,沒有通配符或「dev-master」?
我應該在http://packagist.org/上搜索每個依賴項的最後一個穩定版本嗎?
很好的答案,但你能詳細說明「部署你的應用程序」的步驟嗎?我需要哪些作曲家文件?很明顯,.phar和.lock文件。我還需要composer.json嗎?那麼composer_installer.php呢? –
@BenjaminBrizzi我不能詳細說明「部署你的應用程序」。作曲家只關心依賴關係,而不是你的應用程序本身。通常,「部署你的應用程序」可以是'git clone'。您仍然需要'composer.json',因爲它包含了deps列表。 'composer.lock'只指定你想要安裝的版本。我不知道composer_installer.php是什麼,對不起。 –