Composer.phar Symfony clear cache

Whenever I do a composer.phar installation, it flushes the symfony developer cache.

Is it possible to somehow clear the cache of other environments, for example, production? I know that I can always run the application / console cache: clear --env = prod. But I would like Composer to handle this after capturing the dependencies.

+5
source share
2 answers

In your composer.json you will find the “scripts” section, which should look something like this:

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

As you can see, all commands are stored in one file, Sensio \ Bundle \ DistributionBundle \ Composer \ ScriptHandler :: clearCache () what you are looking for.

, . .

: . , composer.json. , , . "symfony-web-dir" - , ScriptHandler. CommandEvent, ScriptHandler:: getOptions(). , , , , / "extra", script, . , , , , , , config , , , .

+5

, , symlink .

, "symfony-assets-install" node composer.json

"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install": "symlink"
}

src:

+1

All Articles