Database Installation

21 views
Skip to first unread message

84.le0n

unread,
Mar 31, 2012, 11:47:34 AM3/31/12
to joomla-...@googlegroups.com
Hi all,
I'm working on PostgreSQL integration inside CMS after doing its
driver for platform.
I've found some strange code I wish change during installation phases,
file I refer to is installation/models/database.php .

Inside "initialize" function there is a check on
"$options->db_created" , no more present inside cms project, so I
think it's better to remove this check.

At line 82 there is a "getDBO" to check if it's possible to connect to
that database.
I've to change this adding "$options->db_name" instead of null to let
PostgreSQL works (it needs database name to connect to, if not exists
it will correctly fail).
After this try, there are some checks and after some code to create
database only if "select" fails.

I think that it's better to check at line 86 if exception caught is
"JLIB_DATABASE_ERROR_CONNECT_POSTGRESQL", this means that error could
be about server, port, login or database not present, not only about
connection.

Actually this could work for MySQL, it fit very well for this database
but not for others like PostgreSQL that selects a database during
connection, not after this phase.
In fact I told in some discussion to install PostgreSQL in an already
created database.

I could change my driver to search if a database is present during
connection and then throw a new exception if not, but this mean that
inside line 86 need to be called "createDatabase" in an independent
manner of already present.

What are your thought about this ?

Eng. Gabriele Pongelli.

Reply all
Reply to author
Forward
0 new messages