public function update($getNew = true) { global $documentRoot, $_CONFIG, $objUser, $license, $objDatabase; if (@(include_once ASCMS_DOCUMENT_ROOT . '/lib/PEAR/HTTP/Request2.php')) { $_GET['force'] = 'true'; $_GET['silent'] = 'true'; $documentRoot = ASCMS_DOCUMENT_ROOT; $_CONFIG['licenseUpdateInterval'] = 0; $_CONFIG['licenseSuccessfulUpdate'] = 0; $_CONFIG['licenseState'] = ''; if ($getNew) { $_CONFIG['installationId'] = ''; $_CONFIG['licenseKey'] = ''; } $objUser = \FWUser::getFWUserObject()->objUser; $license = \Cx\Core_Modules\License\License::getCached($_CONFIG, $objDatabase); $return = @(include_once ASCMS_DOCUMENT_ROOT . '/core_modules/License/versioncheck.php'); } // we force a version number update. if the license update failed // version number will not be upgraded yet: \Cx\Lib\UpdateUtil::sql('UPDATE `' . DBPREFIX . 'settings` SET `setvalue` = \'' . $_CONFIG['coreCmsVersion'] . '\' WHERE `setid` = 97'); $settingsManager = new \settingsManager(); $settingsManager->writeSettingsFile(); return $return === true; }
} catch (\Cx\Lib\UpdateException $e) { return \Cx\Lib\UpdateUtil::DefaultActionHandler($e); } } if ($objUpdate->_isNewerVersion($_CONFIG['coreCmsVersion'], '3.2.0')) { $crmComponentUpdateFile = dirname(__FILE__) . '/components/module/crm.php'; require_once $crmComponentUpdateFile; $crmUpdate = _crmUpdate(); if ($crmUpdate !== true) { return $crmUpdate; } } // fix tree \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Node')->recover(); require dirname(__FILE__) . '/config.inc.php'; \Cx\Lib\UpdateUtil::sql('UPDATE `' . DBPREFIX . 'settings` SET `setvalue` = \'' . $arrUpdate['cmsVersion'] . '\' WHERE `setname` = \'coreCmsVersion\''); \Cx\Lib\UpdateUtil::sql('UPDATE `' . DBPREFIX . 'settings` SET `setvalue` = \'' . $arrUpdate['cmsCodeName'] . '\' WHERE `setname` = \'coreCmsCodeName\''); \Cx\Lib\UpdateUtil::sql('UPDATE `' . DBPREFIX . 'settings` SET `setvalue` = \'' . $arrUpdate['cmsReleaseDate'] . '\' WHERE `setname` = \'coreCmsReleaseDate\''); \Cx\Lib\UpdateUtil::sql('UPDATE `' . DBPREFIX . 'settings` SET `setvalue` = \'' . $arrUpdate['cmsName'] . '\' WHERE `setname` = \'coreCmsName\''); \Cx\Lib\UpdateUtil::sql('UPDATE `' . DBPREFIX . 'settings` SET `setvalue` = \'' . $arrUpdate['cmsStatus'] . '\' WHERE `setname` = \'coreCmsStatus\''); // define the missing placeholders which are used by settingsManager to locate the settings file if (!defined('ASCMS_INSTANCE_PATH')) { define('ASCMS_INSTANCE_PATH', $_PATHCONFIG['ascms_root']); } if (!defined('ASCMS_INSTANCE_OFFSET')) { define('ASCMS_INSTANCE_OFFSET', $_PATHCONFIG['ascms_root_offset']); } $objSettings = new \settingsManager(); $objSettings->writeSettingsFile(); require $documentRoot . '/config/settings.php'; return true;