Advertisement:

Author Topic: [2.1] Hooks in 2.1  (Read 55747 times)

Offline inter

  • Jr. Member
  • **
  • Posts: 276
  • Gender: Male
    • interlab on GitHub
Re: [2.1] Hooks in 2.1
« Reply #40 on: April 08, 2013, 07:19:13 AM »
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:
Code: [Select]
// Invalidate cache, to be sure!
// ... as long as Load.php can be modified, anyway.
@touch($sourcedir . '/' . 'Load.php');
clearstatcache();

Replace:
Code: [Select]
// 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

Offline Joshua Dickerson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,775
  • Gender: Male
    • joshuaadickerson on GitHub
    • joshuaadickerson on LinkedIn
Re: [2.1] Hooks in 2.1
« Reply #41 on: April 08, 2013, 11:15:08 AM »
That's a good one. Would you mind tracking it as a feature enhancement at https://github.com/SimpleMachines/SMF2.1/issues ? Thanks
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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,035
    • Arantor on GitHub
Re: [2.1] Hooks in 2.1
« Reply #42 on: April 08, 2013, 12:19:59 PM »
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)
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline inter

  • Jr. Member
  • **
  • Posts: 276
  • Gender: Male
    • interlab on GitHub
Re: [2.1] Hooks in 2.1
« Reply #43 on: April 09, 2013, 05:53:40 AM »
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,035
    • Arantor on GitHub
Re: [2.1] Hooks in 2.1
« Reply #44 on: April 09, 2013, 09:39:44 AM »
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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME


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.