src/Zicht/Tool/Container/Container.php
public function exec($cmd)
    {
        if (trim($cmd)) {
            $this->setOutputPrefix('');

            if ($this->resolve('DEBUG')) {
                $this->output->writeln('<comment># ' . join('::', Debug::$scope) . "</comment>");
            }

            if ($this->resolve('EXPLAIN')) {
                if ($this->resolve('INTERACTIVE')) {
                    $this->notice('interactive shell:');
                    $line = '( /bin/bash -c \'' . trim($cmd) . '\' )';
                } else {
                    $line = 'echo ' . escapeshellarg(trim($cmd)) . ' | ' . $this->resolve(array('SHELL'));
                }
                $this->output->writeln($line);
            } else {
                $this->executor->execute($cmd);
            }
        }
    }
public function exec($cmd)
    {
        if (trim($cmd)) {
            $this->setOutputPrefix('');

            if ($this->resolve('DEBUG')) {
                $this->output->writeln('<comment># ' . join('::', Debug::$scope) . "</comment>");
            }

            if ($this->resolve('EXPLAIN')) {
                if ($this->resolve('INTERACTIVE')) {
                    $this->notice('interactive shell:');
                    $line = '( /bin/bash -c \'' . trim($cmd) . '\' )';
                } else {
                    $line = 'echo ' . escapeshellarg(trim($cmd)) . ' | ' . $this->resolve(array('SHELL'));
                }
                $this->output->writeln($line);
            } else {
                $this->executor->execute($cmd);
            }
        }
    }
public function exec ( $ cmd ) { if ( trim ( $ cmd ) ) { $ this -> setOutputPrefix ( '' ) ; if ( $ this -> resolve ( 'DEBUG' ) ) { $ this -> output -> writeln ( '<comment># ' . join ( '::' , Debug :: $ scope ) . "</comment>" ) ; } if ( $ this -> resolve ( 'EXPLAIN' ) ) { if ( $ this -> resolve ( 'INTERACTIVE' ) ) { $ this -> notice ( 'interactive shell:' ) ; $ line = '( /bin/bash -c \'' . trim ( $ cmd ) . '\' )' ; } else { $ line = 'echo ' . escapeshellarg ( trim ( $ cmd ) ) . ' | ' . $ this -> resolve ( array ( 'SHELL' ) ) ; } $ this -> output -> writeln ( $ line ) ; } else { $ this -> executor -> execute ( $ cmd ) ; } } }
Executes a script snippet using the 'executor' service.

@param string $cmd
@return void
Executes a script snippet using the executor service .