summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-06-22 00:00:41 +0200
committerAndreas Gohr <andi@splitbrain.org>2014-06-22 00:00:41 +0200
commit2613efa18dacc46df06cc448fee733c0467a073f (patch)
tree2ffc5dd021a66bbfe6ec97225966616571e171d6
parent8c66b72dd479bad18be7571cb97f8b09cc65488c (diff)
downloadrpg-2613efa18dacc46df06cc448fee733c0467a073f.tar.gz
rpg-2613efa18dacc46df06cc448fee733c0467a073f.tar.bz2
allow config presets with installer
this adds the ability to place a install.conf file next to the install.php which contains additional config options to be written to conf/local.php on completion of the installer. The install.conf is automatically deleted then. This is useful for automated DokuWiki installers or downloaders that take care of downloading DokuWiki and then drop the user in the default install dialog for initial setup. These tools may set up host specific things options like rewrites, image magic path or file permission settings in this preset.
-rw-r--r--install.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/install.php b/install.php
index 20402d3ff..767dd332f 100644
--- a/install.php
+++ b/install.php
@@ -58,6 +58,7 @@ $dokuwiki_hash = array(
'2013-05-10' => '7b62b75245f57f122d3e0f8ed7989623',
'2013-12-08' => '263c76af309fbf083867c18a34ff5214',
'2014-05-05' => '263c76af309fbf083867c18a34ff5214',
+ 'devel' => 'b3ddc3f793eac8c135176e535054c00a',
);
@@ -350,6 +351,16 @@ function store_data($d){
*/
EOT;
+ // add any config options set by a previous installer
+ $preset = __DIR__.'/install.conf';
+ if(file_exists($preset)){
+ $output .= "# preset config options\n";
+ $output .= file_get_contents($preset);
+ $output .= "\n\n";
+ $output .= "# options selected in installer\n";
+ @unlink($preset);
+ }
+
$output .= '$conf[\'title\'] = \''.addslashes($d['title'])."';\n";
$output .= '$conf[\'lang\'] = \''.addslashes($LC)."';\n";
$output .= '$conf[\'license\'] = \''.addslashes($d['license'])."';\n";