Remove obsolete `config_backend` option and not required code

The user preferences backend is now always a `db`.
This commit is contained in:
Sukhwinder Dhillon 2022-05-03 10:16:27 +02:00 committed by Johannes Meyer
parent e7c368b09d
commit aad2419545
5 changed files with 50 additions and 99 deletions

View File

@ -69,7 +69,7 @@ class AccountController extends Controller
$form = new PreferenceForm();
$form->setPreferences($user->getPreferences());
if ($config->get('config_backend', 'db') !== 'none' && isset($config->config_resource)) {
if (isset($config->config_resource)) {
$form->setStore(PreferencesStore::create(new ConfigObject(array(
'resource' => $config->config_resource
)), $user));

View File

@ -37,13 +37,4 @@ class GeneralConfigForm extends ConfigForm
$this->addSubForm($themingConfigForm->create($formData));
$this->addSubForm($domainConfigForm->create($formData));
}
public function onRequest()
{
parent::onRequest();
if ($this->config->get('global', 'config_backend') === 'ini') {
$this->warning('The preferences backend of type INI is deprecated and will be removed with version 2.11');
}
}
}

View File

@ -376,7 +376,6 @@ class Auth
$config = new Config();
}
if ($config->get('global', 'config_backend', 'db') !== 'none') {
$preferencesConfig = new ConfigObject([
'resource' => $config->get('global', 'config_resource')
]);
@ -394,9 +393,6 @@ class Auth
);
$preferences = new Preferences();
}
} else {
$preferences = new Preferences();
}
$user->setPreferences($preferences);

View File

@ -178,34 +178,6 @@ class UserDomainMigration
{
$config = Config::app();
$type = $config->get('global', 'config_backend', 'ini');
switch ($type) {
case 'ini':
$directory = Config::resolvePath('preferences');
$migration = array();
if (DirectoryIterator::isReadable($directory)) {
foreach (new DirectoryIterator($directory) as $username => $path) {
$user = new User($username);
if (! $this->mustMigrate($user)) {
continue;
}
$migrated = $this->migrateUser($user);
$migration[$path] = dirname($path) . '/' . $migrated->getUsername();
}
foreach ($migration as $from => $to) {
rename($from, $to);
}
}
break;
case 'db':
$resourceConfig = ResourceFactory::getResourceConfig($config->get('global', 'config_resource'));
if ($resourceConfig->db === 'mysql') {
$resourceConfig->charset = 'utf8mb4';
@ -253,7 +225,6 @@ class UserDomainMigration
$conn->getDbAdapter()->commit();
}
}
}
protected function migrateRoles()
{

View File

@ -28,9 +28,7 @@ class GeneralConfigStep extends Step
$config[$section][$property] = $value;
}
if ($config['global']['config_backend'] === 'db') {
$config['global']['config_resource'] = $this->data['resourceName'];
}
try {
Config::fromArray($config)
@ -57,12 +55,7 @@ class GeneralConfigStep extends Step
? t('An exception\'s stacktrace is shown to every user by default.')
: t('An exception\'s stacktrace is hidden from every user by default.')
) . '</li>'
. '<li>' . sprintf(
$this->data['generalConfig']['global_config_backend'] === 'ini' ? sprintf(
t('Preferences will be stored per user account in INI files at: %s'),
Config::resolvePath('preferences')
) : t('Preferences will be stored using a database.')
) . '</li>'
. '<li>' . t('Preferences will be stored using a database.') . '</li>'
. '</ul>';
$type = $this->data['generalConfig']['logging_log'];