diff --git a/install.php b/install.php
index 233a05550e..61156e9371 100644
--- a/install.php
+++ b/install.php
@@ -126,14 +126,20 @@ function showForm()
Enable fancy (pretty) URLs. Auto-detection failed, it depends on Javascript.
+
+
+ Database hostname
+
+
+
- MySQL
- PostgreSQL
+ MySQL
+ PostgreSQL
Database type
-
+
Database name
@@ -145,7 +151,7 @@ function showForm()
- Database password
+ Database password (optional)
@@ -169,6 +175,7 @@ function handlePost()
'SMS carrier',
- 'notice_source' => 'notice source',
- 'foreign_services' => 'foreign service')
- as $scr => $name) {
- updateStatus(sprintf("Adding %s data to database...", $name));
- $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn);
- if ($res === false) {
- updateStatus(sprintf("Can't run %d script.", $name), true);
- showForm();
- return;
- }
- }
- updateStatus("Writing config file...");
- $sqlUrl = "mysqli://$username:$password@$host/$database";
- $res = writeConf($sitename, $sqlUrl, $fancy);
- if (!$res) {
- updateStatus("Can't write config file.", true);
- showForm();
- return;
- }
- updateStatus("Done!");
if ($path) $path .= '/';
updateStatus("You can visit your new Laconica site.");
?>
@@ -262,6 +233,57 @@ function handlePost()
'SMS carrier',
+ 'notice_source' => 'notice source',
+ 'foreign_services' => 'foreign service')
+ as $scr => $name) {
+ updateStatus(sprintf("Adding %s data to database...", $name));
+ $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn);
+ if ($res === false) {
+ updateStatus(sprintf("Can't run %d script.", $name), true);
+ showForm();
+ return;
+ }
+ }
+
+ updateStatus("Writing config file...");
+ $sqlUrl = "mysqli://$username:$password@$host/$database";
+ $res = writeConf($sitename, $sqlUrl, $fancy);
+ if (!$res) {
+ updateStatus("Can't write config file.", true);
+ showForm();
+ return;
+ }
+ updateStatus("Done!");
+ }
function writeConf($sitename, $sqlUrl, $fancy)
{
$res = file_put_contents(INSTALLDIR.'/config.php',