2016-09-15 42 views
4

我有一個問題。我想知道是否有任何替代方法生成parameters.yml參數.yml.dist沒有作曲家安裝/更新。在作曲家安裝/更新期間,文件分別生成並被覆蓋。但我希望不通過作曲家。我不知道是否有任何symfony控制檯命令來實現這一點。任何人都有答案?如何在沒有作曲者安裝/更新的情況下生成parameters.yml到parameters.yml.dist

+1

其有點不清楚什麼youre要求。 '生成parameters.yml *到* parameters.yml.dist'是什麼意思?你的意思是'來自'嗎? – DevDonkey

回答

14

您可以只運行composer run-script post-install-cmd

它可能會運行一些其他的腳本,但(在默認的symfony配置與緩存,引導等操作)。

如果你想只有建立parameteres,在你的作曲家/腳本部分創建一個新的部分。就像這樣:

"scripts": { 
    "post-install-cmd": [ 
     "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
    ], 
    "post-update-cmd": [ 
     "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
    ], 
    "build-params": [ 
     "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters" 
    ] 
}, 
... 

,然後只需運行composer run-script build-params

+0

@D Malirty Malyshenko。你太棒了。這正是我想要的。謝謝。 – user1965773

相關問題