// echo nl2br(htmlspecialchars($cont)); if (rex_file::putConfig($configFile, $config) !== false) { $info = rex_i18n::msg('setup_error1', '<a href="' . rex_url::backendController() . '">', '</a>'); header('Location:' . rex_url::backendController()); exit; } else { $error[] = rex_i18n::msg('setup_error2'); } } elseif ($func == 'generate') { // generate all articles,cats,templates,caches $success = rex_delete_cache(); } elseif ($func == 'updateassets') { rex_dir::copy(rex_path::core('assets'), rex_path::coreAssets()); $success = 'Updated assets'; } elseif ($func == 'updateinfos') { $configFile = rex_path::coreData('config.yml'); $config = array_merge(rex_file::getConfig(rex_path::core('default.config.yml')), rex_file::getConfig($configFile)); $settings = rex_post('settings', 'array', []); foreach (['server', 'servername', 'error_email', 'lang'] as $key) { if (!isset($settings[$key]) || !$settings[$key]) { $error[] = rex_i18n::msg($key . '_required'); continue; } $config[$key] = $settings[$key]; try { rex::setProperty($key, $settings[$key]); } catch (InvalidArgumentException $e) { $error[] = rex_i18n::msg($key . '_invalid'); } } $config['debug'] = isset($settings['debug']) && $settings['debug'];
public function testCheckConnectionInvalidDatabase() { $configFile = rex_path::coreData('config.yml'); $config = rex_file::getConfig($configFile); $this->assertTrue(true !== rex_sql::checkDbConnection($config['db'][1]['host'], $config['db'][1]['login'], $config['db'][1]['password'], 'fu-database')); }