public function exec(Api_Console_ConsoleCommandModel $cmd) { $cmdString = $cmd->getCommandString(); $this->checkFileExistence($cmd); $username = AppKitAgaviUtil::getContext()->getUser()->getNsmUser()->user_name; putenv('ICINGAWEB_USER='******'ICINGAWEB_IP=' . $_SERVER['REMOTE_ADDR']); exec($cmdString, $out, $ret); $cmd->setReturnCode($ret); $cmd->setOutput($out); }
public function exec(Api_Console_ConsoleCommandModel $cmd) { $this->connect(); $cmdString = $cmd->getCommandString(); $out = $this->resource->exec($cmdString . '; echo -n "|$?"'); $lines = preg_split('/\\|/', $out); $ret = (int) array_pop($lines); $out = implode('|', $lines); $cmd->setOutput($out); $cmd->setReturnCode($ret); }