public static function dumpAssets(Event $event)
    {
        $options = self::getOptions($event);
        $consoleDir = static::getConsoleDir($event, 'install assets');

        if (null === $consoleDir) {
            return;
        }

        $webDir = $options['symfony-web-dir'];
        $command = 'assetic:dump';

        // if not set falls back to default behaviour of console commands (using SYMFONY_ENV or fallback to 'dev')
        if (!empty($options['ezpublish-asset-dump-env'])) {
            $event->getIO()->write('<error>Use of `ezpublish-asset-dump-env` is deprecated, use SYMFONY_ENV to set anything other then dev for all commands</error>');

            if ($options['ezpublish-asset-dump-env'] === 'none') {
                // If asset dumping is skipped, output help text on how to generate it if needed
                return self::dumpAssetsHelpText($event);
            }

            $command .= ' --env=' . escapeshellarg($options['ezpublish-asset-dump-env']);
        }

        if (!is_dir($consoleDir)) {
            echo 'The symfony console directory (' . $consoleDir . ') specified in composer.json was not found in ' . getcwd() . ', can not install assets.' . PHP_EOL;

            return;
        }

        if (!is_dir($webDir)) {
            echo 'The symfony-web-dir (' . $webDir . ') specified in composer.json was not found in ' . getcwd() . ', can not install assets.' . PHP_EOL;

            return;
        }

        static::executeCommand($event, $consoleDir, $command . ' ' . escapeshellarg($webDir));
    }
public static function dumpAssets(Event $event)
    {
        $options = self::getOptions($event);
        $consoleDir = static::getConsoleDir($event, 'install assets');

        if (null === $consoleDir) {
            return;
        }

        $webDir = $options['symfony-web-dir'];
        $command = 'assetic:dump';

        // if not set falls back to default behaviour of console commands (using SYMFONY_ENV or fallback to 'dev')
        if (!empty($options['ezpublish-asset-dump-env'])) {
            $event->getIO()->write('<error>Use of `ezpublish-asset-dump-env` is deprecated, use SYMFONY_ENV to set anything other then dev for all commands</error>');

            if ($options['ezpublish-asset-dump-env'] === 'none') {
                // If asset dumping is skipped, output help text on how to generate it if needed
                return self::dumpAssetsHelpText($event);
            }

            $command .= ' --env=' . escapeshellarg($options['ezpublish-asset-dump-env']);
        }

        if (!is_dir($consoleDir)) {
            echo 'The symfony console directory (' . $consoleDir . ') specified in composer.json was not found in ' . getcwd() . ', can not install assets.' . PHP_EOL;

            return;
        }

        if (!is_dir($webDir)) {
            echo 'The symfony-web-dir (' . $webDir . ') specified in composer.json was not found in ' . getcwd() . ', can not install assets.' . PHP_EOL;

            return;
        }

        static::executeCommand($event, $consoleDir, $command . ' ' . escapeshellarg($webDir));
    }
public static function dumpAssets ( Event $ event ) { $ options = self :: getOptions ( $ event ) ; $ consoleDir = static :: getConsoleDir ( $ event , 'install assets' ) ; if ( null === $ consoleDir ) { return ; } $ webDir = $ options [ 'symfony-web-dir' ] ; $ command = 'assetic:dump' ; // if not set falls back to default behaviour of console commands (using SYMFONY_ENV or fallback to 'dev') if ( ! empty ( $ options [ 'ezpublish-asset-dump-env' ] ) ) { $ event -> getIO ( ) -> write ( '<error>Use of `ezpublish-asset-dump-env` is deprecated, use SYMFONY_ENV to set anything other then dev for all commands</error>' ) ; if ( $ options [ 'ezpublish-asset-dump-env' ] === 'none' ) { // If asset dumping is skipped, output help text on how to generate it if needed return self :: dumpAssetsHelpText ( $ event ) ; } $ command .= ' --env=' . escapeshellarg ( $ options [ 'ezpublish-asset-dump-env' ] ) ; } if ( ! is_dir ( $ consoleDir ) ) { echo 'The symfony console directory (' . $ consoleDir . ') specified in composer.json was not found in ' . getcwd ( ) . ', can not install assets.' . PHP_EOL ; return ; } if ( ! is_dir ( $ webDir ) ) { echo 'The symfony-web-dir (' . $ webDir . ') specified in composer.json was not found in ' . getcwd ( ) . ', can not install assets.' . PHP_EOL ; return ; } static :: executeCommand ( $ event , $ consoleDir , $ command . ' ' . escapeshellarg ( $ webDir ) ) ; }
Dump minified assets for prod environment under the web root directory.

@param $event Event A instance
Dump minified assets for prod environment under the web root directory .