function action_install($eventData) { global $gLocale, $gLocale, $gStatus; if (strcmp($eventData['applicationfile']['tmp_name'], 'none') != 0) { $tempApplication = new \Innomatic\Application\Application(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), ''); move_uploaded_file($eventData['applicationfile']['tmp_name'], \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/temp/' . $eventData['applicationfile']['name']); if (!$tempApplication->Install(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/temp/' . $eventData['applicationfile']['name'])) { $unmetDeps = $tempApplication->getLastActionUnmetDeps(); $unmetDepsStr = ''; while (list($key, $val) = each($unmetDeps)) { $unmetDepsStr .= ' ' . $val; } $gStatus = $gLocale->getStr('unmetdeps_status') . $unmetDepsStr; } else { $gStatus = $gLocale->getStr('appinstalled_status'); } $unmetSuggs = $tempApplication->getLastActionUnmetSuggs(); $unmetSuggsStr = ''; while (list($key, $val) = each($unmetSuggs)) { $unmetSuggsStr .= ' ' . $val; } if (strlen($unmetSuggsStr)) { $gStatus .= $gLocale->getStr('unmetsuggs_status') . $unmetSuggsStr; } } }
public function RetrieveApplication($repId, $applicationId, $applicationVersion = '') { $result = false; $xmlrpcMessage = new \Innomatic\Webservices\Xmlrpc\XmlRpcMsg('appcentral-server.retrieve_application', array(new \Innomatic\Webservices\Xmlrpc\XmlRpcVal($repId, 'int'), new \Innomatic\Webservices\Xmlrpc\XmlRpcVal($applicationId, 'int'), new \Innomatic\Webservices\Xmlrpc\XmlRpcVal($applicationVersion, 'string'))); $xmlrpcResp = $this->mXClient->Send($xmlrpcMessage); if ($xmlrpcResp) { if (!$xmlrpcResp->FaultCode()) { $xv = $xmlrpcResp->Value(); $tmpFilename = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/temp/appcentral-client/' . md5(uniqid(rand())) . '.tgz'; $fh = fopen($tmpFilename, 'wb'); if ($fh) { fputs($fh, $xv->scalarVal()); fclose($fh); unset($xv); unset($xmlrpcResp); $tmpApplication = new \Innomatic\Application\Application($this->mrRootDb, ''); if ($tmpApplication->Install($tmpFilename)) { $result = true; } } } else { $this->mLogCenter->logEvent(array('root' => ''), 'appcentral-client.appcentral-client.appcentralremoteserver.retrieveapplication', 'Error in response from server: ' . $xmlrpcResp->FaultString(), \Innomatic\Logging\Logger::ERROR); } } else { $this->mLogCenter->logEvent(array('root' => ''), 'appcentral-client.appcentral-client.appcentralremoteserver.retrieveapplication', 'Invalid response from server', \Innomatic\Logging\Logger::ERROR); } return $result; }