N98\Magento\Command\ScriptCommand::_initDefines PHP Method

_initDefines() protected method

protected _initDefines ( Symfony\Component\Console\Input\InputInterface $input )
$input Symfony\Component\Console\Input\InputInterface
    protected function _initDefines(InputInterface $input)
    {
        $defines = $input->getOption('define');
        if (is_string($defines)) {
            $defines = array($defines);
        }
        if (count($defines) > 0) {
            foreach ($defines as $define) {
                if (!strstr($define, '=')) {
                    throw new InvalidArgumentException('Invalid define');
                }
                $parts = BinaryString::trimExplodeEmpty('=', $define);
                $variable = $parts[0];
                $value = null;
                if (isset($parts[1])) {
                    $value = $parts[1];
                }
                $this->scriptVars['${' . $variable . '}'] = $value;
            }
        }
    }