We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit aa1bc621 authored by Evan Prodromou's avatar Evan Prodromou

Make a loop instead of repeating almost identical text in install

parent 8d05768e
...@@ -182,26 +182,17 @@ function handlePost() ...@@ -182,26 +182,17 @@ function handlePost()
showForm(); showForm();
return; return;
} }
updateStatus("Adding SMS carrier data to database..."); foreach (array('sms_carrier' => 'SMS carrier',
$res = runDbScript(INSTALLDIR.'/db/sms_carrier.sql', $conn); 'notice_source' => 'notice source',
if ($res === false) { 'foreign_services' => 'foreign service')
updateStatus("Can't run SMS carrier script.", true); as $scr => $name) {
showForm(); updateStatus(sprintf("Adding %s data to database...", $name));
return; $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn);
} if ($res === false) {
updateStatus("Adding notice source data to database..."); updateStatus(sprintf("Can't run %d script.", $name), true);
$res = runDbScript(INSTALLDIR.'/db/notice_source.sql', $conn); showForm();
if ($res === false) { return;
updateStatus("Can't run notice source script.", true); }
updateStatus("Adding foreign service data to database...");
$res = runDbScript(INSTALLDIR.'/db/foreign_services.sql', $conn);
if ($res === false) {
updateStatus("Can't run foreign service script.", true);
} }
updateStatus("Writing config file..."); updateStatus("Writing config file...");
$sqlUrl = "mysqli://$username:$password@$host/$database"; $sqlUrl = "mysqli://$username:$password@$host/$database";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment