13

There are some scripts that are executed after I run composer.

The problem is that they do things that I don't want, like php assets:install (without --symlink).

So I need to either be able to remove that, or add my own script to do php assets:install --symlink.

What would be the correct way for doing this?

EDIT

In Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets() I can see an option for symlink:

if ($options['symfony-assets-install'] == 'symlink') {
    $symlink = '--symlink ';

Is that configurable somewhere?

ChocoDeveloper
  • 14,160
  • 26
  • 79
  • 117

2 Answers2

33

To install assets with symlinks edit your composer.json (at the end) in this way

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

Then run composer as uusal.

mgiagnoni
  • 3,454
  • 1
  • 20
  • 9
6

If you use composer to deploy to production environments, you may want to set the environment variable SYMFONY_ASSETS_INSTALL to symlink instead. This way production still uses hard copies which is the recommended option.

Marcus Pope
  • 2,293
  • 20
  • 25
  • 1
    I had to do both `SYMFONY_ASSETS_INSTALL=symlink` **and** `export SYMFONY_ASSETS_INSTALL` in my `.profile` file to get this working. – Sam Aug 07 '14 at 09:26