Fix IniStore to save and load proper user preferences
This commit is contained in:
parent
533d2207fd
commit
4f84979c89
|
@ -67,7 +67,7 @@ class IniStore extends PreferencesStore
|
|||
$this->getUser()->getUsername()
|
||||
);
|
||||
} else {
|
||||
$this->preferences = parse_ini_file($this->preferencesFile);
|
||||
$this->preferences = parse_ini_file($this->preferencesFile, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,9 +81,13 @@ class IniStore extends PreferencesStore
|
|||
*/
|
||||
public function save(Preferences $preferences)
|
||||
{
|
||||
$preferences = $preferences->toArray();
|
||||
$this->update(array_diff_assoc($preferences, $this->preferences));
|
||||
$this->delete(array_keys(array_diff_key($this->preferences, $preferences)));
|
||||
$this->preferences = $preferences->toArray();
|
||||
|
||||
// TODO: Elaborate whether we need to patch the contents
|
||||
// $preferences = $preferences->toArray();
|
||||
// $this->update(array_diff_assoc($preferences, $this->preferences));
|
||||
// $this->delete(array_keys(array_diff_key($this->preferences, $preferences)));
|
||||
|
||||
$this->write();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue