Put server details in config.php

https://www.phpbb.com/ideas/
Post Reply
Author:
Wirral Talk
Posted:
Thu Jan 31, 2019 10:23 pm
Rating:
Status:
New
Wirral Talk
Registered User
Posts: 50
Joined: Mon Jun 09, 2014 12:29 am
Location: Wirral, UK
Contact:

Put server details in config.php

Post by Wirral Talk » Thu Jan 31, 2019 10:23 pm

For those that use force-server you need to switch force-server off before backing up the database to make changing server easier (eg copying the board to or from a test server or location).

Why not have server details held in config.php making the above unnecessary. I can see no advantage to hold it in the database, it is basic configuration details of the implementation.

To those not using force-server it would make no difference where server details are stored.

User avatar
AmigoJack
Registered User
Posts: 5571
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Put server details in config.php

Post by AmigoJack » Fri Feb 01, 2019 9:26 am

Wirral Talk wrote:you need to switch force-server off before backing up the database to make changing server easier
I disagree: after having migrated the database content it'd be easy to just run a few UPDATEs with the desired values. Why isn't it in your case?
Wirral Talk wrote:I can see no advantage to hold it in the database
To make it configurable thru a UI. Settings in /config.php must be changed manually, while every other option can be set also by users only having the understanding of how to click and needing explaining texts around it.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

Wirral Talk
Registered User
Posts: 50
Joined: Mon Jun 09, 2014 12:29 am
Location: Wirral, UK
Contact:

Re: Put server details in config.php

Post by Wirral Talk » Mon Feb 04, 2019 7:46 am

AmigoJack wrote:
Fri Feb 01, 2019 9:26 am
I disagree: after having migrated the database content it'd be easy to just run a few UPDATEs with the desired values. Why isn't it in your case?
I do but the general recommendation is not to directly edit the database, many users would be uncomfortable doing this. It would be good to be able to directly mirror the forum's database between the test server and main server.
AmigoJack wrote:
Fri Feb 01, 2019 9:26 am
To make it configurable thru a UI. Settings in /config.php must be changed manually, while every other option can be set also by users only having the understanding of how to click and needing explaining texts around it.
Good point about UI which I hadn't considered, however the explanation conflicts with the need to use UPDATEs as above.

I guess its a case that you can't have it both ways, admittedly there appears to be less need to use force-url these days, I'd forgotten I had it switched on. It is also another example of the lack of normalization in the database as the URL is replicated in both its component and composite form.

User avatar
AmigoJack
Registered User
Posts: 5571
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Put server details in config.php

Post by AmigoJack » Mon Feb 04, 2019 11:39 am

One could argue that installing the software always happens more often than switching the domain - the latter is always a less used case (and even then I guess it happens rarily).
Wirral Talk wrote:
Mon Feb 04, 2019 7:46 am
the general recommendation is not to directly edit the database, many users would be uncomfortable doing this
But one has to set up a database to begin with, because source and target DBMS for sure are different installations - who's doing this, if not the "user"? It's the point where users start acting inconsistent: "oh, setting up a new domain, a new HTTP server and a new DBMS is fine, and inputting my backup (which IS a bunch of INSERTs) is fine, but doing two lousy UPDATEs myself is something I shouldn't do - that's too dangerous".

Next thing you want is a feature that should automatically patch all database content (posts, reports, PMs, forums...) which has URIs to the old domain to have the new URIs. How are you doing that/expecting it to "work" without getting in touch with your database? I'm sure there are many users who don't even think about consequences like these when switching domains.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

Wirral Talk
Registered User
Posts: 50
Joined: Mon Jun 09, 2014 12:29 am
Location: Wirral, UK
Contact:

Re: Put server details in config.php

Post by Wirral Talk » Mon Feb 04, 2019 2:10 pm

Your comments have given me an idea, as the test server is on my local network, I can direct the url onto my local network or internet at will, database is a full mirror, nothing would need changing.

Thank you for your input, I'll accept the thumbs down on the suggestion.

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3175
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Put server details in config.php

Post by thecoalman » Mon Feb 04, 2019 10:38 pm

config.php is loaded pretty early, perhaps they could be in both places. If they are set in config.php you could give them precedence over default or database values.

Wirral Talk
Registered User
Posts: 50
Joined: Mon Jun 09, 2014 12:29 am
Location: Wirral, UK
Contact:

Re: Put server details in config.php

Post by Wirral Talk » Tue Feb 05, 2019 11:49 am

thecoalman wrote:
Mon Feb 04, 2019 10:38 pm
config.php is loaded pretty early, perhaps they could be in both places. If they are set in config.php you could give them precedence over default or database values.
That's pretty good, initially I baulked at the idea of it being in two locations but considering the frequency that this will be needed it would be a nice simple quick-fix to be able to edit your config.php and hence be able to keep the databases identical if you so wished. I prefer the idea of a file being different rather than the database being different when I am shoving things around.

So having that over-ride facility available rather than in use by default would be tidy imho.

User avatar
warmweer
Registered User
Posts: 2012
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Put server details in config.php

Post by warmweer » Tue Feb 05, 2019 12:29 pm

Wirral Talk wrote:
Tue Feb 05, 2019 11:49 am
thecoalman wrote:
Mon Feb 04, 2019 10:38 pm
config.php is loaded pretty early, perhaps they could be in both places. If they are set in config.php you could give them precedence over default or database values.
That's pretty good, initially I baulked at the idea of it being in two locations but considering the frequency that this will be needed it would be a nice simple quick-fix to be able to edit your config.php and hence be able to keep the databases identical if you so wished. I prefer the idea of a file being different rather than the database being different when I am shoving things around.

So having that over-ride facility available rather than in use by default would be tidy imho.
I have to admit I was originally against that idea. But I usually don't "vote" on impulse. With the latest twist to the idea, I'm now inclined to vote in favour of the idea (but it's currently an impulse so I'll wait a bit). I'm still not at ease with the triple configuration (database fields which are not used when force server = false, database fields which are used when force_server = true, and config.php settings).
I do feel the direction of being able to work on the database (update/upgrade/anything) on different servers without having to keep on editing when transferring is worth being investigated.
A bug is a feature that hasn't made it to the manual (yet)

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3175
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Put server details in config.php

Post by thecoalman » Tue Feb 05, 2019 2:00 pm

warmweer wrote:
Tue Feb 05, 2019 12:29 pm
I'm still not at ease with the triple configuration
There should probably be warning in the ACP the value is overridden by config.php and you can even list what it is.

Post Reply

Return to “phpBB Ideas”