protected function undeployApplication(PackageInterface $package) { // Add vendor autoloads to access Innomatic Legacy Kernel bridge $vendorDir = $this->composer->getConfig()->get('vendor-dir'); require $vendorDir . '/autoload.php'; $appName = $package->getName(); $appName = substr($appName, strpos($appName, '/') + 1); $legacyKernel = new Kernel(); $result = $legacyKernel->runCallback(function () use($appName) { $appId = \Innomatic\Application\Application::getAppIdFromName($appName); $app = new \Innomatic\Application\Application(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $appId); return $app->uninstall(); /* * Due to different handling of dependencies uninstall order * in Composer, we ignore applications that cannot be * uninstalled. */ }); if (!$result) { $this->io->write("<error>Application {$appName} must be manually uninstalled from Innomatic due to reversed dependencies</error>"); } }
$script->cleanExit(); break; case 'appenable': $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null); $appid = \Innomatic\Application\Application::getAppIdFromName($argv[3]); if ($tenant->enableApplication($appid)) { print "Application {$argv['3']} enabled to tenant {$argv['2']}\n"; $script->cleanExit(); } else { print "Application {$argv['3']} not enabled to tenant {$argv['2']}\n"; $script->cleanExit(1); } break; case 'appdisable': $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null); $appid = \Innomatic\Application\Application::getAppIdFromName($argv[3]); if ($tenant->disableApplication($appid)) { print "Application {$argv['3']} disabled from tenant {$argv['2']}\n"; $script->cleanExit(); } else { print "Application {$argv['3']} not disabled from tenant {$argv['2']}\n"; $script->cleanExit(1); } break; default: print 'Usage: php innomatic/core/scripts/tenant.php command' . "\n"; print 'Type tenant.php -h for a list of supported commands' . "\n"; } } catch (\Exception $e) { echo $e; }
public function install($tmpfilepath, $updateOnce = false) { // Checks if the given path is a directory. This may happen when not // giving a file to the application installation page. if (is_dir($tmpfilepath)) { return false; } $result = false; $innomatic = $this->container; if ($innomatic->getState() == \Innomatic\Core\InnomaticContainer::STATE_DEBUG) { $innomatic->getLoadTimer()->Mark('applicationinstallstart'); } if (file_exists($tmpfilepath)) { // Moves temp file to applications repository and extracts it // $fname = $this->container->getHome() . 'core/applications/' . basename($tmpfilepath); @copy($tmpfilepath, $fname); $basetmpdir = $tmpdir = $this->container->getHome() . 'core/temp/appinst/' . md5(microtime()); @mkdir($tmpdir, 0755); $olddir = getcwd(); @chdir($tmpdir); if (substr($fname, -4) == '.zip') { } else { try { $appArchive = new \PharData($fname); $tarFileName = substr($fname, 0, strpos($fname, '.')) . '.tar'; if (file_exists($tarFileName)) { unlink($tarFileName); } $appArchive->decompress(); } catch (\BadMethodCallException $e) { } try { $appArchive->extractTo($tmpdir); } catch (Exception $e) { } } // Checks if the files are into a directory instead of the root // if (!@is_dir($tmpdir . '/setup')) { $dhandle = opendir($tmpdir); while (false != ($file = readdir($dhandle))) { if ($file != '.' && $file != '..' && (is_dir($tmpdir . '/' . $file . '/setup') or is_dir($tmpdir . '/' . $file . '/innomatic/setup'))) { if (is_dir($tmpdir . '/' . $file . '/setup')) { $tmpdir = $tmpdir . '/' . $file; } else { $tmpdir = $tmpdir . '/' . $file . '/innomatic'; } break; } } closedir($dhandle); } $this->basedir = $tmpdir; // Checks for definition and structure files // if (file_exists($tmpdir . '/setup/bundle.ini')) { $applicationsArray = file($tmpdir . '/setup/bundle.ini'); $result = true; while (list(, $application) = each($applicationsArray)) { $application = trim($application); if (strlen($application) and file_exists($tmpdir . '/applications/' . $application)) { $tempApplication = new Application($this->rootda); if (!$tempApplication->Install($tmpdir . '/applications/' . $application)) { $result = false; } } } } elseif (file_exists($tmpdir . '/setup/application.xml')) { $genconfig = $this->parseApplicationDefinition($tmpdir . '/setup/application.xml'); $this->appname = $genconfig['ApplicationIdName']; // Checks if the application has been already installed // $tmpquery = $this->rootda->execute('SELECT id,appfile FROM applications WHERE appid=' . $this->rootda->formatText($this->appname)); if (!$tmpquery->getNumberRows()) { // Application is new, so it will be installed // // Dependencies check // $this->unmetdeps = array(); $this->unmetsuggs = array(); $appdeps = new ApplicationDependencies(); $deps = $appdeps->explodeDependencies($genconfig['ApplicationDependencies']); $suggs = $appdeps->explodeDependencies($genconfig['ApplicationSuggestions']); if ($deps != false) { $this->unmetdeps = $appdeps->checkApplicationDependencies(0, '', $deps); } else { $this->unmetdeps = false; } // Suggestions check // if ($suggs != false) { $unmetsuggs = $appdeps->checkApplicationDependencies(0, '', $suggs); if (is_array($unmetsuggs)) { $this->unmetsuggs = $unmetsuggs; } } // If dependencies are ok, go on // if ($this->unmetdeps == false) { // Gets serial number for the application // $this->serial = $this->rootda->getNextSequenceValue('applications_id_seq'); $this->rootda->execute('INSERT INTO applications VALUES ( ' . $this->serial . ',' . $this->rootda->formatText($genconfig['ApplicationIdName']) . ',' . $this->rootda->formatText($genconfig['ApplicationVersion']) . ',' . $this->rootda->formatText($genconfig['ApplicationDate']) . ',' . $this->rootda->formatText($genconfig['ApplicationDescription']) . ',' . $this->rootda->formatText(basename($tmpfilepath)) . ',' . $this->rootda->formatText($this->rootda->fmtfalse) . ',' . $this->rootda->formatText($genconfig['ApplicationAuthor']) . ',' . $this->rootda->formatText($genconfig['ApplicationAuthorEmail']) . ',' . $this->rootda->formatText($genconfig['ApplicationAuthorWeb']) . ',' . $this->rootda->formatText($genconfig['ApplicationSupportEmail']) . ',' . $this->rootda->formatText($genconfig['ApplicationBugsEmail']) . ',' . $this->rootda->formatText($genconfig['ApplicationCopyright']) . ',' . $this->rootda->formatText($genconfig['ApplicationLicense']) . ',' . $this->rootda->formatText($genconfig['ApplicationLicenseFile']) . ',' . $this->rootda->formatText($genconfig['ApplicationChangesFile']) . ',' . $this->rootda->formatText($genconfig['ApplicationMaintainer']) . ',' . $this->rootda->formatText($genconfig['ApplicationMaintainerEmail']) . ',' . $this->rootda->formatText($genconfig['ApplicationCategory']) . ',' . $this->rootda->formatText($genconfig['ApplicationIconFile']) . ')'); // Application dir creation // @mkdir($this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'], 0755); // Defs files // if ($dhandle = @opendir($tmpdir . '/setup')) { while (false != ($file = readdir($dhandle))) { if ($file != '.' && $file != '..' && is_file($tmpdir . '/setup/' . $file)) { @copy($tmpdir . '/setup/' . $file, $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $file); } } closedir($dhandle); } // Adds applications dependencies // $appdeps->addDependenciesArray($genconfig['ApplicationIdName'], $deps, ApplicationDependencies::TYPE_DEPENDENCY); $appdeps->addDependenciesArray($genconfig['ApplicationIdName'], $suggs, ApplicationDependencies::TYPE_SUGGESTION); $this->setOptions(explode(',', trim($genconfig['ApplicationOptions'], ' ,'))); $this->HandleStructure($tmpdir . '/setup/application.xml', Application::INSTALL_MODE_INSTALL, $tmpdir); if (strlen($genconfig['ApplicationLicenseFile']) and file_exists($tmpdir . '/setup/' . $genconfig['ApplicationLicenseFile'])) { @copy($tmpdir . '/setup/' . $genconfig['ApplicationLicenseFile'], $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $genconfig['ApplicationLicenseFile']); } if (strlen($genconfig['ApplicationChangesFile']) and file_exists($tmpdir . '/setup/' . $genconfig['ApplicationChangesFile'])) { @copy($tmpdir . '/setup/' . $genconfig['ApplicationChangesFile'], $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $genconfig['ApplicationChangesFile']); } if (strlen($genconfig['ApplicationIconFile']) and file_exists($tmpdir . '/setup/' . $genconfig['ApplicationIconFile'])) { @copy($tmpdir . '/setup/' . $genconfig['ApplicationIconFile'], $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $genconfig['ApplicationIconFile']); } // Checks if it is an extension application // $genconfig = $this->parseApplicationDefinition($tmpdir . '/setup/application.xml'); $ext = $this->rootda->fmtfalse; if ($genconfig['ApplicationIsExtension'] == 'y') { $ext = $this->rootda->fmttrue; $this->onlyextension = true; } elseif ($genconfig['ApplicationIsExtension'] == 'n') { $ext = $this->rootda->fmtfalse; $this->onlyextension = false; } elseif ($this->onlyextension) { $ext = $this->rootda->fmttrue; } $this->rootda->execute('UPDATE applications SET onlyextension=' . $this->rootda->formatText($ext) . ' WHERE appid=' . $this->rootda->formatText($this->appname)); $result = true; if ($this->container->getConfig()->Value('SecurityAlertOnApplicationOperation') == '1') { $innomaticSecurity = new \Innomatic\Security\SecurityManager(); $innomaticSecurity->SendAlert('Application ' . $this->appname . ' has been installed'); unset($innomaticSecurity); } if ($result == true) { if ($this->container->getEdition() == \Innomatic\Core\InnomaticContainer::EDITION_SINGLETENANT and $this->appname != 'innomatic' and $ext != $this->rootda->fmttrue) { $domainsQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT id FROM domains'); if ($domainsQuery->getNumberRows()) { $this->Enable($domainsQuery->getFields('id')); } } $log = $this->container->getLogger(); $log->logEvent('Innomatic', 'Installed application ' . $this->appname, \Innomatic\Logging\Logger::NOTICE); } } } else { $appdata = $tmpquery->getFields(); $this->serial = $appdata['id']; // Application will be updated // if ($this->serial) { // Dependencies check // $this->unmetdeps = array(); $this->unmetsuggs = array(); $appdeps = new ApplicationDependencies(); $deps = $appdeps->explodeDependencies($genconfig['ApplicationDependencies']); $suggs = $appdeps->explodeDependencies($genconfig['ApplicationSuggestions']); if ($deps != false) { $this->unmetdeps = $appdeps->checkApplicationDependencies(0, '', $deps); } else { $this->unmetdeps = false; } // Suggestions check // if ($suggs != false) { $unmetsuggs = $appdeps->checkApplicationDependencies(0, '', $suggs); if (is_array($unmetsuggs)) { $this->unmetsuggs = $unmetsuggs; } } // If dependencies are ok, go on // if ($this->unmetdeps == false) { // Creates lock file // touch($this->container->getHome() . 'core/temp/upgrading_system_lock'); // :WARNING: evil 20020506: possible problems on Windows systems // It has a 'permission denied'. // Removes old application file // if (basename($fname) != $appdata['appfile'] and file_exists($this->container->getHome() . 'core/applications/' . $appdata['appfile'])) { @unlink($this->container->getHome() . 'core/applications/' . $appdata['appfile']); } // Updates applications table // $this->rootda->execute('UPDATE applications SET appversion=' . $this->rootda->formatText($genconfig['ApplicationVersion']) . ', appdate=' . $this->rootda->formatText($genconfig['ApplicationDate']) . ', appdesc=' . $this->rootda->formatText($genconfig['ApplicationDescription']) . ', appfile=' . $this->rootda->formatText(basename($tmpfilepath)) . ', author=' . $this->rootda->formatText($genconfig['ApplicationAuthor']) . ', authoremail=' . $this->rootda->formatText($genconfig['ApplicationAuthorEmail']) . ', authorsite=' . $this->rootda->formatText($genconfig['ApplicationAuthorWeb']) . ', supportemail=' . $this->rootda->formatText($genconfig['ApplicationSupportEmail']) . ', bugsemail=' . $this->rootda->formatText($genconfig['ApplicationBugsEmail']) . ', copyright=' . $this->rootda->formatText($genconfig['ApplicationCopyright']) . ', license=' . $this->rootda->formatText($genconfig['ApplicationLicense']) . ', licensefile=' . $this->rootda->formatText($genconfig['ApplicationLicenseFile']) . ', changesfile=' . $this->rootda->formatText($genconfig['ApplicationChangesFile']) . ', maintainer=' . $this->rootda->formatText($genconfig['ApplicationMaintainer']) . ', maintaineremail=' . $this->rootda->formatText($genconfig['ApplicationMaintainerEmail']) . ', category=' . $this->rootda->formatText($genconfig['ApplicationCategory']) . ', iconfile=' . $this->rootda->formatText($genconfig['ApplicationIconFile']) . ' WHERE id=' . (int) $this->serial); $genconfig = $this->parseApplicationDefinition($tmpdir . '/setup/application.xml'); // Script files - only before handlestructure // if ($dhandle = @opendir($tmpdir . '/setup')) { while (false != ($file = readdir($dhandle))) { if ($file != '.' and $file != '..' and $file != 'application.xml' and is_file($tmpdir . '/setup/' . $file)) { @copy($tmpdir . '/setup/' . $file, $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $file); } } closedir($dhandle); } $this->HandleStructure($tmpdir . '/setup/application.xml', Application::INSTALL_MODE_UPDATE, $tmpdir); if (strlen($genconfig['ApplicationLicenseFile']) and file_exists($tmpdir . '/setup/' . $genconfig['ApplicationLicenseFile'])) { @copy($tmpdir . '/setup/' . $genconfig['ApplicationLicenseFile'], $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $genconfig['ApplicationLicenseFile']); } if (strlen($genconfig['ApplicationChangesFile']) and file_exists($tmpdir . '/setup/' . $genconfig['ApplicationChangesFile'])) { @copy($tmpdir . '/setup/' . $genconfig['ApplicationChangesFile'], $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $genconfig['ApplicationChangesFile']); } if (strlen($genconfig['ApplicationIconFile']) and file_exists($tmpdir . '/setup/' . $genconfig['ApplicationIconFile'])) { @copy($tmpdir . '/setup/' . $genconfig['ApplicationIconFile'], $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/' . $genconfig['ApplicationIconFile']); } // setup files - only after handlestructure // @copy($tmpdir . '/setup/application.xml', $this->container->getHome() . 'core/applications/' . $genconfig['ApplicationIdName'] . '/application.xml'); // Checks if it is an extension application // $ext = $this->rootda->fmtfalse; if ($genconfig['ApplicationIsExtension'] == 'y') { $ext = $this->rootda->fmttrue; $this->onlyextension = true; } elseif ($genconfig['ApplicationIsExtension'] == 'n') { $ext = $this->rootda->fmtfalse; $this->onlyextension = false; } elseif ($this->onlyextension) { $ext = $this->rootda->fmttrue; } $this->rootda->execute('UPDATE applications SET onlyextension=' . $this->rootda->formatText($ext) . ' WHERE appid=' . $this->rootda->formatText($this->appname)); $this->setOptions(explode(',', trim($genconfig['ApplicationOptions'], ' ,'))); if ($this->appname != 'innomatic') { // Remove old dependencies // $appdeps->removeAllDependencies($this->serial); // Adds new Applications dependencies // $appdeps->addDependenciesArray($genconfig['ApplicationIdName'], $deps, ApplicationDependencies::TYPE_DEPENDENCY); $appdeps->addDependenciesArray($genconfig['ApplicationIdName'], $suggs, ApplicationDependencies::TYPE_SUGGESTION); } $result = true; if (function_exists('apc_reset_cache')) { apc_reset_cache(); } if ($updateOnce == false) { $this->Install($tmpfilepath, true); // Removes lock file // unlink($this->container->getHome() . 'core/temp/upgrading_system_lock'); if (\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getConfig()->Value('SecurityAlertOnApplicationOperation') == '1') { $innomaticSecurity = new \Innomatic\Security\SecurityManager(); $innomaticSecurity->SendAlert('Application ' . $this->appname . ' has been updated'); unset($innomaticSecurity); } if ($result == true) { $log = $this->container->getLogger(); $log->logEvent('Innomatic', 'Updated application ' . $this->appname, \Innomatic\Logging\Logger::NOTICE); } } } /* else $this->mLog->logEvent( 'innomatic.applications.applications.install', 'Structure definition file for application '.$this->appname. ' does not exists', \Innomatic\Logging\Logger::ERROR ); */ } else { $log = $this->container->getLogger(); $log->logEvent('innomatic.applications.applications.install', 'Empty application serial', \Innomatic\Logging\Logger::ERROR); } } } else { $log = $this->container->getLogger(); if (!file_exists($tmpdir . '/setup/application.xml')) { $log->logEvent('innomatic.applications.applications.install', 'Application structure file ' . $tmpdir . '/setup/application.xml' . ' not found', \Innomatic\Logging\Logger::ERROR); } } // Cleans up temp stuff // @chdir($olddir); \Innomatic\Io\Filesystem\DirectoryUtils::unlinkTree($basetmpdir); if (file_exists($tmpfilepath)) { @unlink($tmpfilepath); } } else { if (!file_exists($tmpfilepath)) { $log = $this->container->getLogger(); $log->logEvent('innomatic.applications.applications.install', 'Temporary application file (' . $tmpfilepath . ') does not exists', \Innomatic\Logging\Logger::ERROR); } } if ($innomatic->getState() == \Innomatic\Core\InnomaticContainer::STATE_DEBUG) { $innomatic->getLoadTimer()->Mark('applicationinstallend'); $log = $this->container->getLogger(); $log->logEvent('innomatic.applications.application.install', 'Application installation load time: ' . $innomatic->getLoadTimer()->getSectionLoad('applicationinstallend'), \Innomatic\Logging\Logger::DEBUG); } return $result; }
public function enable($domainid) { $result = false; $hook = new \Innomatic\Process\Hook($this->rootDA, 'innomatic', 'application.enable'); if ($hook->callHooks('calltime', $this, array('tenantserial' => $domainid, 'applicationid' => $this->id)) == \Innomatic\Process\Hook::RESULT_OK) { if ($this->id) { // Checks if the application exists in applications table // $modquery = $this->rootDA->execute('SELECT * FROM applications WHERE id=' . (int) $this->id); if ($modquery->getNumberRows() == 1) { $appdata = $modquery->getFields(); if ($appdata['onlyextension'] != $this->rootDA->fmttrue) { // Checks if the structure file still exists // if (file_exists($this->container->getHome() . 'core/applications/' . $appdata['appid'] . '/application.xml')) { $this->appname = $appdata['appid']; $domainquery = $this->rootDA->execute('SELECT * FROM domains WHERE id=' . $this->rootDA->formatText((int) $domainid)); $domaindata = $domainquery->getFields(); // Connects to the tenant database if Innomatic has been installed in ASP edition. if ($this->container->getEdition() == \Innomatic\Core\InnomaticContainer::EDITION_MULTITENANT) { $args['dbtype'] = $domaindata['dataaccesstype']; $args['dbname'] = $domaindata['domaindaname']; $args['dbhost'] = $domaindata['dataaccesshost']; $args['dbport'] = $domaindata['dataaccessport']; $args['dbuser'] = $domaindata['dataaccessuser']; $args['dbpass'] = $domaindata['dataaccesspassword']; $args['dblog'] = $this->container->getHome() . 'core/domains/' . $domaindata['domainid'] . '/log/dataaccess.log'; $dasnString = $args['dbtype'] . '://' . $args['dbuser'] . ':' . $args['dbpass'] . '@' . $args['dbhost'] . ':' . $args['dbport'] . '/' . $args['dbname'] . '?' . 'logfile=' . $args['dblog']; $this->tenantDA = \Innomatic\Dataaccess\DataAccessFactory::getDataAccess(new \Innomatic\Dataaccess\DataAccessSourceName($dasnString)); $this->tenantDA->connect(); } else { $this->tenantDA = $this->rootDA; } // Dependencies check // $this->unmetdeps = array(); $this->unmetsuggs = array(); $appdeps = new ApplicationDependencies(); $modenabled = $appdeps->IsEnabled($this->appname, $domaindata['domainid']); $unmetdeps = $appdeps->checkDomainApplicationDependencies($this->appname, $domaindata['domainid'], ApplicationDependencies::TYPE_DEPENDENCY); // Recursively enable application dependencies. if (is_array($unmetdeps)) { foreach ($unmetdeps as $depId => $depName) { $appQuery = $this->rootDA->execute('SELECT id FROM applications WHERE appid=' . $this->rootDA->formatText($depName)); // Check if the application has been already enabled. // This happens when an application before in the dependencies list // as already enabled the current item. if ($appdeps->isEnabled($depName, $domaindata['domainid'])) { unset($unmetdeps[$depId]); continue; } // Enable the application. $app = new Application($this->rootDA, $appQuery->getFields('id')); if ($app->enable($domainid)) { unset($unmetdeps[$depId]); } } } $unmetsuggs = $appdeps->checkDomainApplicationDependencies($this->appname, $domaindata['domainid'], ApplicationDependencies::TYPE_SUGGESTION); // Suggestions check // if (is_array($unmetsuggs)) { $this->unmetsuggs = $unmetsuggs; } // If dependencies are ok, go on // if ($unmetdeps == false and !$modenabled) { $result = $this->HandleStructure($this->container->getHome() . 'core/applications/' . $appdata['appid'] . '/application.xml', Application::INSTALL_MODE_ENABLE, $this->container->getHome() . 'core/applications/' . $appdata['appid'] . '/', $domainid); $modquery = $this->rootDA->execute('SELECT id FROM applications WHERE appid=' . $this->rootDA->formatText($this->appname)); $this->rootDA->execute('INSERT INTO applications_enabled VALUES (' . $this->id . ',' . $this->rootDA->formatText($domainid) . ',' . $this->rootDA->formatDate(time()) . ',' . $this->rootDA->formatDate(time()) . ',' . $this->rootDA->formatText($this->rootDA->fmttrue) . ')'); if (\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getConfig()->Value('SecurityAlertOnApplicationDomainOperation') == '1') { $innomaticSecurity = new \Innomatic\Security\SecurityManager(); $innomaticSecurity->SendAlert('Application ' . $appdata['appid'] . ' has been enabled to domain ' . $domaindata['domainid']); unset($innomaticSecurity); } if ($hook->callHooks('applicationenabled', $this, array('tenantserial' => $domainid, 'applicationid' => $this->id)) != \Innomatic\Process\Hook::RESULT_OK) { $result = false; } } else { $this->unmetdeps = $unmetdeps; } //if ( $result == true ) $this->mLog->logEvent( // 'Innomatic', // 'Uninstalled application '.$this->appname, // \Innomatic\Logging\Logger::NOTICE //); $domainquery->free(); } else { $log = $this->container->getLogger(); $log->logEvent('innomatic.applications.applications.enable', 'Structure file ' . $this->container->getHome() . 'core/applications/' . $appdata['appid'] . '/application.xml' . ' for application ' . $appdata['appid'] . ' was not found', \Innomatic\Logging\Logger::ERROR); } } else { $log = $this->container->getLogger(); $log->logEvent('innomatic.applications.applications.enable', 'Tried to enable application ' . $appdata['appid'] . ', but it is an extension only application', \Innomatic\Logging\Logger::ERROR); } } else { $log = $this->container->getLogger(); $log->logEvent('innomatic.applications.applications.enable', 'A application with id ' . $this->id . ' was not found in applications table', \Innomatic\Logging\Logger::ERROR); } $modquery->free(); } else { $log = $this->container->getLogger(); $log->logEvent('innomatic.applications.applications.enable', 'Empty application id', \Innomatic\Logging\Logger::ERROR); } } return $result; }