Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate parameters.yml to parameters.yml.dist without composer install/update

I have a question. I want to know is there any alternate ways to generate parameters.yml to parameters.yml.dist without composer install/update. During composer install/update the file is generated and overwritten respectively. But I'm looking to do without going through composer. I wonder is there any symfony console commands to achieve this. Anyone has answer?

like image 396
user1965773 Avatar asked Sep 15 '16 07:09

user1965773


1 Answers

You can just run composer run-script post-install-cmd

It will probably run some other scripts though (in default symfony configuration operate with cache, bootstrap and so on).

If you want to only build parameteres, make a new section in your composer/scripts section. Like this:

"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"
    ]
},
...

and then just run composer run-script build-params

like image 104
Dmitry Malyshenko Avatar answered Sep 24 '22 01:09

Dmitry Malyshenko