开发者

How do web apps do automated updates without breaking config settings?

开发者 https://www.devze.com 2022-12-19 16:24 出处:网络
Let\'s say I have a mediawiki installation. I mess about with it, add little hacks to make the wikipedia logo change into tigger, and bounce up and down.

Let's say I have a mediawiki installation. I mess about with it, add little hacks to make the wikipedia logo change into tigger, and bounce up and down.

Now it's time to update to the newest version, so I download it and run the update script. Let say it changed several variables, like $wglogo, the image path to the logo. How does the update script ensure that the logo image path changes (according to the specs of the new version, in this figurative example), while keeping tigger bouncing on the main page?

That is: How do new versions integrate changes to the configuration file without overwriting the user-defined changes in the config file-to-be-o开发者_开发问答verwrit?


Typically we try not to change config files on update. Almost all new configuration settings are optional and thus are not added to the config files upon upgrade. In the rare case where we have to change an existing setting, make the smallest change required to the config file so as not to affect any other things.

Testing is very important. Gather as many real client configurations as possible and create unit tests for the auto-updater to validate that the configs don't gets screwed upon upgrade.

0

精彩评论

暂无评论...
验证码 换一张
取 消