Remove obsolete `config_backend` option and not required code
The user preferences backend is now always a `db`.
This commit is contained in:
parent
e7c368b09d
commit
aad2419545
|
@ -69,7 +69,7 @@ class AccountController extends Controller
|
||||||
|
|
||||||
$form = new PreferenceForm();
|
$form = new PreferenceForm();
|
||||||
$form->setPreferences($user->getPreferences());
|
$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(
|
$form->setStore(PreferencesStore::create(new ConfigObject(array(
|
||||||
'resource' => $config->config_resource
|
'resource' => $config->config_resource
|
||||||
)), $user));
|
)), $user));
|
||||||
|
|
|
@ -37,13 +37,4 @@ class GeneralConfigForm extends ConfigForm
|
||||||
$this->addSubForm($themingConfigForm->create($formData));
|
$this->addSubForm($themingConfigForm->create($formData));
|
||||||
$this->addSubForm($domainConfigForm->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');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -376,7 +376,6 @@ class Auth
|
||||||
$config = new Config();
|
$config = new Config();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config->get('global', 'config_backend', 'db') !== 'none') {
|
|
||||||
$preferencesConfig = new ConfigObject([
|
$preferencesConfig = new ConfigObject([
|
||||||
'resource' => $config->get('global', 'config_resource')
|
'resource' => $config->get('global', 'config_resource')
|
||||||
]);
|
]);
|
||||||
|
@ -394,9 +393,6 @@ class Auth
|
||||||
);
|
);
|
||||||
$preferences = new Preferences();
|
$preferences = new Preferences();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$preferences = new Preferences();
|
|
||||||
}
|
|
||||||
|
|
||||||
$user->setPreferences($preferences);
|
$user->setPreferences($preferences);
|
||||||
|
|
||||||
|
|
|
@ -178,34 +178,6 @@ class UserDomainMigration
|
||||||
{
|
{
|
||||||
$config = Config::app();
|
$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'));
|
$resourceConfig = ResourceFactory::getResourceConfig($config->get('global', 'config_resource'));
|
||||||
if ($resourceConfig->db === 'mysql') {
|
if ($resourceConfig->db === 'mysql') {
|
||||||
$resourceConfig->charset = 'utf8mb4';
|
$resourceConfig->charset = 'utf8mb4';
|
||||||
|
@ -253,7 +225,6 @@ class UserDomainMigration
|
||||||
$conn->getDbAdapter()->commit();
|
$conn->getDbAdapter()->commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected function migrateRoles()
|
protected function migrateRoles()
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,9 +28,7 @@ class GeneralConfigStep extends Step
|
||||||
$config[$section][$property] = $value;
|
$config[$section][$property] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['global']['config_backend'] === 'db') {
|
|
||||||
$config['global']['config_resource'] = $this->data['resourceName'];
|
$config['global']['config_resource'] = $this->data['resourceName'];
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Config::fromArray($config)
|
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 shown to every user by default.')
|
||||||
: t('An exception\'s stacktrace is hidden from every user by default.')
|
: t('An exception\'s stacktrace is hidden from every user by default.')
|
||||||
) . '</li>'
|
) . '</li>'
|
||||||
. '<li>' . sprintf(
|
. '<li>' . t('Preferences will be stored using a database.') . '</li>'
|
||||||
$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>'
|
|
||||||
. '</ul>';
|
. '</ul>';
|
||||||
|
|
||||||
$type = $this->data['generalConfig']['logging_log'];
|
$type = $this->data['generalConfig']['logging_log'];
|
||||||
|
|
Loading…
Reference in New Issue