protected function deployApplication($packageDir)
 {
     // Add vendor autoloads to access Innomatic Legacy Kernel bridge
     $vendorDir = $this->composer->getConfig()->get('vendor-dir');
     require $vendorDir . '/autoload.php';
     $legacyKernel = new Kernel();
     $result = $legacyKernel->runCallback(function () use($packageDir) {
         $app = new \Innomatic\Application\Application(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess());
         $result['status'] = true;
         $result['unmetdeps'] = '';
         if (!$app->install($packageDir)) {
             $unmetDeps = $app->getLastActionUnmetDeps();
             $unmetDepsStr = '';
             while (list(, $val) = each($unmetDeps)) {
                 $unmetDepsStr .= ' ' . $val;
             }
             $result['status'] = false;
             $result['unmetdeps'] = $unmetDepsStr;
         }
         return $result;
     });
     if (!$result['status']) {
         throw new \RuntimeException("Dependencies error:" . $result['unmetdeps']);
     }
 }
function action_uninstall($eventData)
{
    global $gLocale, $gLocale, $wuiPage, $gStatus;
    $tempApplication = new \Innomatic\Application\Application(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $eventData['appid']);
    if (!$tempApplication->uninstall()) {
        $unmetDeps = $tempApplication->getLastActionUnmetDeps();
        while (list($key, $val) = each($unmetDeps)) {
            $unmetDepsStr .= ' ' . $val;
        }
        $gStatus = $gLocale->getStr('removeunmetdeps_status') . $unmetDepsStr;
    } else {
        $gStatus = $gLocale->getStr('moduninstalled_status');
    }
}
示例#3
0
 public function disableApplication($appid)
 {
     $result = false;
     $hook = new \Innomatic\Process\Hook($this->rootda, 'innomatic', 'domain.application.disable');
     if ($hook->callHooks('calltime', $this, array('domainserial' => $this->domainserial, 'appid' => $appid)) == \Innomatic\Process\Hook::RESULT_OK) {
         if (!empty($this->dataAccess) and !empty($appid) and $this->isApplicationEnabled($appid)) {
             $modquery = $this->rootda->execute('SELECT appid FROM applications WHERE id=' . (int) $appid);
             $tmpmod = new \Innomatic\Application\Application($this->rootda, $appid);
             $this->container->setCurrentDomain($this);
             if ($tmpmod->Disable($this->domainserial)) {
                 if ($hook->CallHooks('applicationdisabled', $this, array('domainserial' => $this->domainserial, 'appid' => $appid)) == \Innomatic\Process\Hook::RESULT_OK) {
                     $result = true;
                 }
                 $log = $this->container->getLogger();
                 $log->logEvent($this->domainid, 'Disabled application ' . $modquery->getFields('appid'), \Innomatic\Logging\Logger::NOTICE);
                 $this->domainlog->logEvent($this->domainid, 'Disabled application ' . $modquery->getFields('appid'), \Innomatic\Logging\Logger::NOTICE);
             }
             $this->unmetdeps = $tmpmod->getLastActionUnmetDeps();
         }
     }
     return $result;
 }