Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
Changing a config setting from PHP
iainhallam #1
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: Changing a config setting from PHP
As per my other post about automating plugin installations for an extensive internal template, is there a good way to set a single configuration value for the Wiki from PHP code, or would I be better off appending lines to the local.php file?
Avatar
LarsDW223 #2
Member since Sep 2014 · 448 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
IMHO it would be better to place it in a file.

But you can just write into the config array. But then you need to think about what setting you are changing and to what time. Also no user can see that your plugin changed a setting if it is only in the code so it might be hard to troubelshoot if something is not reacting as it should and it's caused by your config change maybe.
Avatar
cziehr #3
Member since Jan 2011 · 634 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
In reply to post #1
I think it would be the best way to modify conf/local.php via PHP, for example with https://www.php.net/manual/en/function.str-replace.php
I think it isn't hard to write a PHP-code which modifys local.php if you have some PHP-skills.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-12-08, 21:44:25 (UTC +01:00)