Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Safer Install Script!
#1
The current fresh install script is extremely hostile! It's unforgivable to drop an existing database, even if you put a Javascript warning up to let people know what's coming!

What I don't understand is why, if the database you specify already exists (which implies there's data in it already) you would drop it instead of just adding your new tables into it? Especially when you can conditionally create the database if it doesn't exist.

Here's the patch, somebody put it in into install/index.php straight away. Geez, this has the potential to be an absolutely awful first-run experience for new users. I'm disgusted.

Code:
install/index.php
170,173c170
<         $result = mysql_query("DROP DATABASE IF EXISTS {$GLOBALS['database']}")
<               or die("<br>Unable to Create Database - Error in query:" . mysql_error());
<
<         $result = mysql_query("CREATE DATABASE {$GLOBALS['database']}")
---
>         $result = mysql_query("CREATE DATABASE IF NOT EXISTS {$GLOBALS['database']}")
#2
Thanks for the input. The installer has been that way since day one, which is not to say it is right, but you are actually the first person in ten years that has had an issue with that. The installer is going to be re-worked quite a bit for the next release, so I will make sure to have it be safer on fresh installs.

Thanks.
#3
I'll be first one to admit that I'm paranoid. I'm glad no one else has had problems, but I think there should be a reasonable expectation that software should be safe to install in the majority of circumstances.

Imagine if you bought a new iPod and it told you it had to delete and reinitalize your iTunes library whether you had already been using it or not-- that's what OpenDocMan does with an existing MySQL database right now, and as I said, that's a really hostile thing to do to a brand new user.

Thanks for the quick response Steve.


Forum Jump:


Users browsing this thread: 1 Guest(s)