Last modified: 2008-11-21 00:32:12 UTC
In HTMLFileCache.php, the isFileCacheGood() function has a side effect wherein mFileCache member variable is initialized, isFileCachedGood() calls isFileCached() calls fileCacheName() initialize $mFileCache. This mFileCache should be initialized in the constructor, not just initialized to "", but to a relevant file path, e.g. "/var/tmp/file_cache/2/29/Help%3AChocolate.html". Further compounding the awkwardness of mFileCache initialization, there is a possibility for a nasty program crash. In Article.php, there is a line of code that looks like this. ob_start( array(&$cache, 'saveToFileCache' ) ); The callback function saveToFileCache() will be called at program termination. If there is no $mFileCache initialized, then a $mFileCache will built on the fly. Unfortunately, at program termination, all global objects have their destructors called. Lack of global objects will make it impossible to call Title::getPrefixedDBkey() to determine namespace. Specifically $wgContLang will go out of scope. Without $wgContLang, it will be impossible to build $mFileCache, at least for those wiki pages that have namespace.
Created attachment 5535 [details] HTMLFileCache modified to initialize mFileCache in constructor. This patch is my fix for the aforementioned bug. It is much better than the one line fix I mentioned previously.
The fastest way to fix the problem is replacing a single line in the constructor. $this->mFileCache = ''; replaced with $this->mFileCache = $this->fileCacheName(); The attached patch is a much better fix though. It's a lot more clean.
Could you possibly upload the file as a unified diff?
Created attachment 5536 [details] diff patch that will propery initialize $mFileCache in constructor
Fixed in r43790