MyBB Community Forums

Full Version: Adding custom cache rebuild functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Right now, if a plugin adds a cache, there is no way for a plugin author to include a rebuild/reload function for that cache.

I was looking at this last night, and there is an easy way to fix this. Currently the cache page checks if the method_exists in the cache class, all you need to do is add a function_exists check as well. This will allow plugin authors to include their own rebuild/reload function if they add their own cache.

Anyone agree with this suggestion?
I support this.
Definitely a +1 from me.
I've made a pull request.
https://github.com/mybb/mybb/pull/207
I really like this idea Smile
If your plugin want to have a option "rebuild cache" we need to insert manually of function into a file inc/datacache.php like this:
function update_NameOfYourCache()
	{
	}
(2014-01-16, 08:10 PM)Starpaul20 Wrote: [ -> ]Anyone agree with this suggestion?

Definitely.
(2014-02-21, 10:41 PM)glover Wrote: [ -> ]If your plugin want to have a option "rebuild cache" we need to insert manually of function into a file inc/datacache.php like this:
function update_NameOfYourCache()
	{
	}

and that is the problem, editing of core files. We know how to do it, we want a way to have it part of the plugin directly
Do it! Do it! :p
I agree with you, and more good faq about making plugins and cache&task system Smile
Pages: 1 2