hook not triggered / integrate_update_settings_file

Started by danielrichter, December 31, 2021, 02:49:24 AM

Previous topic - Next topic

Sesquipedalian

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

danielrichter

#21
Quote from: Sesquipedalian on January 31, 2022, 03:42:07 PM
Quote from: danielrichter on January 25, 2022, 02:59:50 PMlooks good from my point of view, but when I try to save it says:

Unknown config_var 'cache_redis'

It looks like you have stumbled upon a bug. Specifically, the
saveSettings()
 function currently uses a hard-coded list of names for settings to store in Settings.php, and rejects all others. That list should not be hard-coded, so we will have to change the relevant code.

Thanks for the issue report, will take a look into to see when it's fixed / included.
I would hardcode the settings in the meanwhile.
As you can see, there is sadly no "remove" icon:




Sesquipedalian

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

danielrichter

I don't see an uninstall option / where to find this?

Sesquipedalian

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sesquipedalian

Also, pull request #7284, which fixes issue #7282, has been merged into SMF, so update your local copy of SMF to the latest version, and then you should be able to save your $cache_redis setting using the admin panel without running into that "Unknown config_var 'cache_redis'" error.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

danielrichter

@Sesquipedalian works. Thank you so much!
Any actual docs how to implement the mod "structure"?
At the moment I've edited the ManageSettings.english.php and included the predis directory myself (to include the redis driver).
How to make sure there's an uninstall routine?

At the moment my "mod" contains two files:

Sources/Cache/APIs/Redis.php -> containing all caching logic / interacting with the redis driver
redis.php -> inside "main" folder, calling the add_integration_function() function to make sure the integration hook is triggered

Is there any chance to store sessions of SMF inside redis (caching driver), so they are independent from the webserver itself (we are running SMF inside a kubernetes cluster, so the webrequest of a user may hit a different webserver then before).

Kindred

Сл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."

danielrichter

Will use this mod as SDK, since I wasn't able to find an actual SDK.
See here.

@Sesquipedalian

Is there any chance to store sessions of SMF inside redis (caching driver), so they are independent from the webserver itself (we are running SMF inside a kubernetes cluster, so the webrequest of a user may hit a different webserver then before).

Arantor

As I outlined before you should be configuring the sessions in PHP, not SMF, and turning off SMF's database handling.

For example: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-redis-server-as-a-session-handler-for-php-on-ubuntu-14-04

(The paths will be different but the principle is the same, you configure your PHP.ini file in your container to point at your Redis server)

danielrichter

@Sesquipedalian is there a known bug?
When I try to disable the

QuoteUse database driven sessions

SMF crashes.
From error file I get:

QuoteFri Feb 04 12:33:35.156241 2022] [php7:error] [pid 2747] [client 192.168.56.1:50530] PHP Fatal error:  Uncaught Error: Function name must be a string in /var/www/html/forum2/Sources/ManageServer.php:548\nStack trace:\n#0 /var/www/html/forum2/Sources/Subs.php(5340): ModifyCookieSettings()\n#1 /var/www/html/forum2/Sources/ManageServer.php(136): call_helper()\n#2 /var/www/html/forum2/Sources/Admin.php(499): ModifySettings()\n#3 /var/www/html/forum2/index.php(186): AdminMain()\n#4 {main}\n  thrown in /var/www/html/forum2/Sources/ManageServer.php on line 548, referer: http://forum2.local.dev/index.php?action=admin;area=serversettings;sa=cookie;XXXXX

danielrichter


Sesquipedalian

I can't reproduce that error, but if this is continuing to happen to you, please open a new issue on GitHub.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

danielrichter

@Sesquipedalian
Where can I download the latest SMF version (I tried https://github.com/SimpleMachines/SMF2.1 ) but it seems to be incomplete (PHP Fatal error:  require_once(): Failed opening required '/var/www/html/SMF2.1-release-2.1/Settings.php' (include_path='.:/usr/share/php') in /var/www/html/SMF2.1-release-2.1/index.php on line 48).

Will provide detailed bugreport, but I modified the latest release with the two fixes from the bug report, you opened for my config var issue, so I would like to make sure everything is up2date.

Diego Andrés

You need to download the release in GH, or here https://download.simplemachines.org/
If you are downloading the files from GH, you'll find the rest of the files you are missing  in the other folder

SMF Tricks - Free & Premium Responsive Themes for SMF.

Sesquipedalian

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

danielrichter

@Sesquipedalian

do you know who reviewed my mod?
Received a message from @SMF Customization Team with the following content:

  • After editing board, the api produces errors due to negative cache values used.
  • The API should implement isSupported.
  • Overall, the mod has issues in how the logic is supposed to work.

I'll implement isSupported() for sure. But regarding point 1 & 3 I don't understand what's going wrong in detail.
Negative cache values are allowed in redis itself (and SMF will set them, not my "redis mod" itself), negative values will lead for the keys to be deleted by redis itself.
Can someone from SMF team please specify Overall, the mod has issues in how the logic is supposed to work. so I can take a deeper look into?

Doug Heffernan

Quote from: danielrichter on March 21, 2022, 08:53:40 AM@Sesquipedalian

do you know who reviewed my mod?
Received a message from @SMF Customization Team with the following content:

  • After editing board, the api produces errors due to negative cache values used.
  • The API should implement isSupported.
  • Overall, the mod has issues in how the logic is supposed to work.

I'll implement isSupported() for sure. But regarding point 1 & 3 I don't understand what's going wrong in detail.
Negative cache values are allowed in redis itself (and SMF will set them, not my "redis mod" itself), negative values will lead for the keys to be deleted by redis itself.
Can someone from SMF team please specify Overall, the mod has issues in how the logic is supposed to work. so I can take a deeper look into?

This is something best discussed in private imo. You can reply to the pm that you received from the SMF Customization Team. From personal experience I know that they are very helpful.

Sesquipedalian

For the record, the Development Team and the Customization Team are separate teams that operate independently. Even my own mods are still subject to review by the Customization Team, just like anyone else's.

As Doug has already suggested quite correctly, you best route at this point is to talk with the Customization Team via the personal message discussion they have initiated with you.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

danielrichter

Still no answer, wrote to them at March 14, 2022, 05:55:39 AM, still no answer, can somebody please "bump" them  8)
-Thank you!

Advertisement: