Advertisement:

Author Topic: I apologize for the absurd question, but...  (Read 17792 times)

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #20 on: August 06, 2012, 10:35:21 AM »
And that still doesn't clear the cache ;)
Yes of course, but you already posted about that so I didn't add the thing. :P

Yeah, I know, I should have... O:)


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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,560
  • Gender: Male
    • Kindred-999 on GitHub
Re: I apologize for the absurd question, but...
« Reply #21 on: August 06, 2012, 10:40:23 AM »
Sorck,

No...   what Arantor is discussing if the code done for Wedge.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,823
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #22 on: August 06, 2012, 10:44:05 AM »
Quote
Yes, there is an extra database query per page load/an extra cache hit.

Yes, and that's over and above what you're already doing for mod settings anyway.

Quote
This hooks thing seems interesting... I've never really looked through them in any detail in SMF 2.x or smCore. Am I right in assuming that the hook deletion things is related to smCore?

Nope. As Kindred says it's what I did for Wedge, after a serious amount of benchmarking and testing, and thinking about it. I have no idea what smCore does, and to be honest I don't really care either.

There is another issue that hasn't been touched on directly in this debate - but it is the reason why the hooks must be cleared: if you do the upgrade files may be removed but the hooks that reference them may not have been.

My approach is to not actually engage the hooks until you know for certain the files etc are present - meaning that you have the overhead of doing that per page load, but the trade-off of being able to delete a plugin by merely deleting a folder and never having to worry about anything else is a serious bonus for me.

It's more to illustrate the deficiencies in the current process and one route that they can be solved by - something that I think SMF 2.1 should take into account a bit more than I understand it does currently.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline NinaSay

  • Newbie
  • *
  • Posts: 3
Re: I apologize for the absurd question, but...
« Reply #23 on: September 12, 2012, 05:13:04 PM »
I know it has been a while since I replied, but thank you for the information. I will be attempting the upgrade this week.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #24 on: September 21, 2012, 06:18:13 AM »
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P

Code: [Select]
<?php
require_once('SSI.php');
echo 
'Remove any hooks for the removed mods<br /><br />';
$smcFunc['db_query']('''DELETE FROM {db_prefix}settings WHERE variable LIKE {string:variable}%', array('variable' => 'integrate_'));
echo 
'Now fixing the cache...<br /><br />';
cache_put_data('modsettings'null0);
?>

Hope you don't mind if I have stolen your query for repair settings... O:)
https://github.com/emanuele45/tools/commit/db9a843b0a3ccafc889668ccb27a6d8d8cf95377


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.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Sorck on GitHub
    • Second Sphere
Re: I apologize for the absurd question, but...
« Reply #25 on: September 28, 2012, 06:31:58 PM »
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P

Code: [Select]
<?php
require_once('SSI.php');
echo 
'Remove any hooks for the removed mods<br /><br />';
$smcFunc['db_query']('''DELETE FROM {db_prefix}settings WHERE variable LIKE {string:variable}%', array('variable' => 'integrate_'));
echo 
'Now fixing the cache...<br /><br />';
cache_put_data('modsettings'null0);
?>

Hope you don't mind if I have stolen your query for repair settings... O:)
https://github.com/emanuele45/tools/commit/db9a843b0a3ccafc889668ccb27a6d8d8cf95377
Yep, you're fine to do so - it's nothing special. :P

Though I do hope you tested to see if it works before committing it...

TheListener

  • Guest
Re: I apologize for the absurd question, but...
« Reply #26 on: September 28, 2012, 06:35:55 PM »
Emanuele test something before he uses it?

How do ya think he breaks so many things?

 :D

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #27 on: September 28, 2012, 07:01:00 PM »
Emanuele test something before he uses it?
^^ This!

* emanuele likes use others to do tests! >:D

BTW since it's only in my repo for now it's not a big issue. Sooner or later I'll test it... lol


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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,823
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #28 on: September 29, 2012, 11:40:09 AM »
*cough* Look at the commit...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #29 on: September 30, 2012, 05:07:06 AM »


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.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Sorck on GitHub
    • Second Sphere
Re: I apologize for the absurd question, but...
« Reply #30 on: September 30, 2012, 05:55:25 AM »
Out of interest, will SMF not escape the '%' character if it's being put in as type string?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,823
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #31 on: September 30, 2012, 01:19:58 PM »
No, it won't. And if you put it outside as you had it, you'd end up with LIKE 'integrate_'% which is invalid.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.