From 3fe182e86503a9e95183fe6d641e511a4d3eb0f1 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 23 Jun 2009 17:37:01 +1200 Subject: added dbtype detection - and only install mysql stuff if mysql selected --- install.php | 114 ++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 46 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index 233a05550..61156e937 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', -- cgit v1.2.3-54-g00ecf