[drupal-devel] [bug] Change 'database' to 'dbname' in db_url and INSTALL.txt

kbahey drupal-devel at drupal.org
Sun Aug 21 20:51:31 UTC 2005


Issue status update for 
http://drupal.org/node/29324
Post a follow up: 
http://drupal.org/project/comments/add/29324

 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     bug reports
 Priority:     minor
 Assigned to:  Anonymous
 Reported by:  Cvbge
 Updated by:   kbahey
 Status:       patch (code needs review)

Users are the ones who edit this files, and they are often not
developers. What is obvious for us developers, is totally foreign to
others.


I prefer an atomic approach to this: a variable for each component, and
we combine them internally to form the database URL.


There is even no need for an array, since users can be confused by the
=> syntax.


// Database type, either 'mysql' or 'pgsql'
$db_type = 'mysql';
// Database name
$db_name = 'drupal';
// Database user name
$db_user = 'drupal';
// Database password
$db_password = 'secretthing';
// Database host name, normally 'localhost'
$db_host = 'localhost';
// Database port, normally leave it as it is
$db_port = '';


We then combine that to:
$db_url = "$db_type://$db_name:$db_password@db_host/db_name";




kbahey



Previous comments:
------------------------------------------------------------------------

Sun, 21 Aug 2005 17:02:34 +0000 : Cvbge

Attachment: http://drupal.org/files/issues/dbname.diff (1.68 KB)

I've seen several times that users forgot to change the 'database' in
$db_url to their real database name when installing drupal. They have
done all other steps, set up db_url but forgot only to change the
database.
I suspect that it's because 'database' does not look as something to be
changed. So I've changed it to dbname.




------------------------------------------------------------------------

Sun, 21 Aug 2005 17:14:57 +0000 : chx

Attachment: http://drupal.org/files/issues/this_patch_is_for_dumb_users_who_can_not_read_a_proper_install_text.patch (700 bytes)

Well,I think INSTALL.txt is fine especially because users do not read
it, if they would, then they would have no problem. Now, let's see this
version for settings.php




------------------------------------------------------------------------

Sun, 21 Aug 2005 17:20:31 +0000 : killes at www.drop.org

dumb users should use civicspace installer...




------------------------------------------------------------------------

Sun, 21 Aug 2005 17:31:17 +0000 : Morbus Iff

Chx's path goes a little too far. I'm ambivalent about this one,
honestly, but if it does get switched, at least use "db_name" and not
"dbname". The "db_" follows the previously established "standard" of
"db_url".




------------------------------------------------------------------------

Sun, 21 Aug 2005 18:15:34 +0000 : Cvbge

Attachment: http://drupal.org/files/issues/dbname2.diff (1.71 KB)

This patch is not for users good, but for us. The so called "dumb" users
come to -support and waste *our* time.


Attached a patch with 'database_name' version (which is IMO better then
db_name or dbname).


But I think we should change db_url syntax and use array-like settings.
That would be clearer, easier for user, fix http://drupal.org/node/26836
and maybe fix problems with special characters in password. Sorry, I'm
not going to make a patch for it, I have other things to do.




------------------------------------------------------------------------

Sun, 21 Aug 2005 19:51:05 +0000 : Morbus Iff

I'm not fond of an array approach. The syntax we're currently using is
the "normal" way of indicating database connection information for most
database interfaces - I'd rather teach users the "normal" way of marking
up their information, such that they can use it in other applications,
than teach them PHP arrays.







More information about the drupal-devel mailing list