Page 1 of 1

Move all general settings out of DB?

Posted: Tue Sep 13, 2011 4:54 pm
by LazyBadger
Can I hope to see (all? mandatory changeable?) general blog settings in just plain-text files (f.e serendipity_config.inc.php)?
Why?! Because now in order to
- move blog to new hostname|location
- clone blog-skeleton (with big amount of used plugins it have sense)
I must to change in new bog (editing dump|reconfiguring blog by hand) at least
- full absolute path
- Site URL

Re: Move all general settings out of DB?

Posted: Wed Sep 14, 2011 1:31 pm
by garvinhicking
Hi!

Sure, you can just write an event plugin that listens on frontend_configure and then include a PHP file where you simply use:

Code: Select all

<?php
$serendipity['key'] = 'your value';
The whole config of the serendipity_config database is simply populated into the $serendipity array, so you can overwrite that after the config is loaded frmo the DB.

However for your case I'd suggest a simply move.php script like:

Code: Select all

<?php
include 'serendipity_config.inc.php';
serendipity_db_query("UPDATE serendipity_config SET value = "' . dirname(__FILE__) . '" WHERE key = 'serendipityPath'");
(Not tested, just food for thought)

HTH,
Garvin