News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

I apologize for the absurd question, but...

Started by NinaSay, August 05, 2012, 09:52:36 PM

Previous topic - Next topic

emanuele

Quote from: Arantor on August 06, 2012, 09:35:13 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.

Kindred

Sorck,

No...   what Arantor is discussing if the code done for Wedge.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

QuoteYes, 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.

QuoteThis 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.

NinaSay

I know it has been a while since I replied, but thank you for the information. I will be attempting the upgrade this week.

emanuele

Quote from: Sorck on August 06, 2012, 09:48:12 AM
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P

<?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.

Sorck

Quote from: emanuele on September 21, 2012, 06:18:13 AM
Quote from: Sorck on August 06, 2012, 09:48:12 AM
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P

<?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

Emanuele test something before he uses it?

How do ya think he breaks so many things?

:D

emanuele

Quote from: Old Fossil on September 28, 2012, 06:35:55 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.

Arantor


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.

Sorck

Out of interest, will SMF not escape the '%' character if it's being put in as type string?

Arantor

No, it won't. And if you put it outside as you had it, you'd end up with LIKE 'integrate_'% which is invalid.

Advertisement: