/** * @DI\Observe("console.command") */ public function onExecute(ConsoleCommandEvent $event) { $command = $event->getCommand(); if ($command->getName() === 'assetic:dump') { $command = new DumpCommand(); $command->setContainer($this->container); $input = new ArrayInput(array()); $output = new ConsoleOutput(); $resultCode = $command->run($input, $output); } }
public function dumpAssets($environment) { if ($this->output) { $this->output->writeln('Dumping translations...'); } $translationDumpCommand = new TranslationDumpCommand(); $translationDumpCommand->setContainer($this->container); $translationDumpCommand->run(new ArrayInput(array()), $this->output ?: new NullOutput()); if ($this->output) { $this->output->writeln('Compiling javascripts...'); } $assetDumpCmd = new DumpCommand(); $assetDumpCmd->setContainer($this->container); $assetDumpCmd->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'Env', $environment)); $assetDumpCmd->run(new ArrayInput(array()), $this->output ?: new NullOutput()); }