MyBB Community Forums

Full Version: [Bug] Cache Remove Method missing?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been learning about Cache and stuff these days.

I have found there is no method in MyBB to remove a cache item.

So is it that there is some function and i dont know it or its really a bug?

EDIT:

Sorry, I dont know how to use Github Sad So I cant post there. I tried, but its just too hard Toungue.
There is cache->handler->delete (for non-db cache), and (in PluginLibrary) cache_delete()
MyBB 1.8 will include a delete cache method. MyBB 1.6 is feature locked so this will not be added to it.
Well I know that I can use: $cache->handler->delete

But the default Cache method is DB, so your method is useless.
Then use $db->delete_query as well...
As said already 1.8 will have this feature.
As Jordan pointed out, you can use $db->delete_query(...) and then check if $cache->handler is set to use the $cache->handler->delete method as well.

This is the be the best way to do this within the 1.6.x series.