public function runCommand($cmd, $options, $params) { $c = \Magento\Framework\Connect\Command::getInstance($cmd); $c->run($cmd, $options, $params); }
/** * Run commands from \Magento\Framework\Connect\Command * * @param string $command * @param array $options * @param array $params * @return boolean|\Magento\Framework\Connect\Error */ public function run($command, $options = array(), $params = array()) { @set_time_limit(0); @ini_set('memory_limit', '256M'); if (empty($this->_cmdCache[$command])) { \Magento\Framework\Connect\Command::getCommands(); /** * @var $cmd \Magento\Framework\Connect\Command */ $cmd = \Magento\Framework\Connect\Command::getInstance($command); if ($cmd instanceof \Magento\Framework\Connect\Error) { return $cmd; } $this->_cmdCache[$command] = $cmd; } else { /** * @var $cmd \Magento\Framework\Connect\Command */ $cmd = $this->_cmdCache[$command]; } $ftp = $this->getConfig()->remote_config; if (strlen($ftp) > 0) { $options = array_merge($options, array('ftp' => $ftp)); } $cmd->run($command, $options, $params); if ($cmd->ui()->hasErrors()) { return false; } else { return true; } }