【问题标题】:How to generate parameters.yml to parameters.yml.dist without composer install/update如何在没有作曲家安装/更新的情况下将 parameters.yml 生成到 parameters.yml.dist
【发布时间】:2017-01-23 03:42:38
【问题描述】:

我有一个问题。我想知道是否有任何替代方法可以在没有作曲家安装/更新的情况下生成 parameters.yml 到 parameters.yml.dist。在作曲家安装/更新期间,文件分别生成和覆盖。但我希望不通过作曲家。我想知道是否有任何 symfony 控制台命令来实现这一点。谁有答案?

【问题讨论】:

  • 有点不清楚你在问什么。 '生成 parameters.yml to parameters.yml.dist' 是什么意思?你的意思是“来自”吗?

标签: composer-php symfony


【解决方案1】:

你可以运行composer run-script post-install-cmd

它可能会运行一些其他脚本(在默认的 symfony 配置中使用缓存、引导等)。

如果您想构建参数,请在您的作曲家/脚本部分创建一个新部分。像这样:

"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

【讨论】:

  • @Dmirty Malyshenko。你真棒。这正是我想要的。谢谢。
猜你喜欢
  • 2016-07-18
  • 2013-07-01
  • 2018-10-21
  • 2018-01-15
  • 1970-01-01
  • 2021-10-07
  • 1970-01-01
  • 1970-01-01
  • 2019-03-12
相关资源
最近更新 更多