@tsteur opened this Pull Request on September 29th 2020 Member

Was adding some tests to make sure config migration works. There used to be some issues where we needed to update configs like this

        $config = Config::getInstance();
        $section = $config->{$this->section};
        if (!is_array($section)) {
            $section = array();
        }
        $section[$this->key] = $this->value;
        $config->{$this->section} = $section;
        $config->forceSave();

instead of this (which is current implementation of Config\Set class)

        $config = Config::getInstance();
        $config->{$this->section}[$this->key] = $this->value;

Because the value used to be only updated in the array but not in the underlying config because the Config::__set or so would not be triggered. Looks like everything is now passed by referenced and seems to work so no actual change is needed by the looks. I also tested with my PHP 7.4 it seems to work fine and updating the config directly does seem to work now.

This Pull Request was closed on September 29th 2020
Powered by GitHub Issue Mirror