Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Install should Disable the Cache of the Site before it starts the install/upgrade/migration #1015

Closed eSilverStrike closed 2 years ago

eSilverStrike commented 4 years ago

Before starting any process in the install we should disable the cache system completely (cached data, theme files , etc...) as information stored in these cache files could be outdated or cannot be read properly if things have changed in a newer version of Geeklog or a plugin.

For example lib-common is loaded several times which means the topic tree is loaded which is stored in a cache file by calling the function CACHE_check_instance. When disabled CACHE_check_instance would always return an empty string forcing a rebuild of the topic tree.

Disabling the cache is better than clearing the cache as the cache would have to be cleared on each version upgrade of Geeklog and a plugin just in case it reads data from a cached file.

We can use the install constant GL_INSTALL_ACTIVE in Geeklog to check if the install is running and to disable the cache as needed.

We should also clear the cache before loading the success page of the install just to get rid of any old cached files before that page loads since those old cached files could be for older versions of Geeklog or Plugins and this is the first time the new version of Geeklog will be used.

eSilverStrike commented 4 years ago

Maybe add a setting for this as well for the developer mode for testing purposes...

mystralkk commented 4 years ago

Fixed with change set 2313dd4.