protected function execute(InputInterface $input, OutputInterface $output)
{
$this->_scriptFilename = $input->getArgument('filename');
$this->_stopOnError = $input->getOption('stop-on-error');
$this->_initDefines($input);
$script = $this->_getContent($this->_scriptFilename);
$commands = explode("\n", $script);
$this->initScriptVars();
foreach ($commands as $commandString) {
$commandString = trim($commandString);
if (empty($commandString)) {
continue;
}
$firstChar = substr($commandString, 0, 1);
switch ($firstChar) {
// comment
case '#':
continue;
break;
// set var
// set var
case '$':
$this->registerVariable($output, $commandString);
break;
// run shell script
// run shell script
case '!':
$this->runShellCommand($output, $commandString);
break;
default:
$this->runMagerunCommand($input, $output, $commandString);
}
}
}