News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[2.1] Hooks in 2.1

Started by Suki, October 05, 2011, 04:13:04 PM

Previous topic - Next topic

inter

integrate_clean_cache

for example if you use library which uses own folders of a cache which you too would like to clear in case of forum cache flush

Subs.php

Find:

// Invalidate cache, to be sure!
// ... as long as Load.php can be modified, anyway.
@touch($sourcedir . '/' . 'Load.php');
clearstatcache();


Replace:

// Invalidate cache, to be sure!
// ... as long as Load.php can be modified, anyway.
@touch($sourcedir . '/' . 'Load.php');

        call_integration_hook('integrate_clean_cache');

clearstatcache();
Sorry for my English

Joshua Dickerson

That's a good one. Would you mind tracking it as a feature enhancement at https://github.com/SimpleMachines/SMF2.1/issues ? Thanks
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Arantor

Um, why is it a good idea? The whole point of the cache subsystem is that its content is not supposed to be relied upon to exist and plugins actually shouldn't be manually dumping stuff into the cache anyway (because that also means if they are, they're not using proper backends that aren't I/O bound, they should be using cache_put_data and cache_get_data which safely abstract away what actual backend is in use)
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

inter

there are libraries which create temporal files
(the generated files for fast operation of library which are updated only in case of physical deleting manually)
here I also thought that would be quite good if they could be cleared together with the general cache flush of a forum
Sorry for my English

Arantor

Then it should be the library taking care of it itself in the first place, not requiring a hook for that purpose. Or it should be using the proper facilities. Either way, I don't see the need for the hook.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: