Skip to content

Commit

Permalink
Improve Oracle DB connection check in install.php
Browse files Browse the repository at this point in the history
Oracle supports DB bindings in two ways:
1. Use hostname, username/password and database name
2. Use tns name (insert into hostname field) and username/password, database name is still empty

Original patch provided by Carsten Grohmann in issue #13227

Porting to 1.3 - Conflicts:
	admin/install.php
  • Loading branch information
dregad committed Oct 16, 2013
1 parent b531419 commit 803446e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion admin/install.php
Expand Up @@ -185,7 +185,20 @@ function InsertData( $p_table, $p_data ) {

if( 0 == $t_install_state ) {
print_test( 'Setting Database Type', '' !== $f_db_type, true, 'database type is blank?' );
print_test( 'Checking Database connection settings exist', ( $f_dsn !== '' || ( $f_database_name !== '' && $f_db_username !== '' && $f_hostname !== '' ) ), true, 'database connection settings do not exist?' );

$t_db_conn_exists = ( $f_dsn !== '' || ( $f_database_name !== '' && $f_db_username !== '' && $f_hostname !== '' ) );
# Oracle supports binding in two ways:
# - hostname, username/password and database name
# - tns name (insert into hostname field) and username/password, database name is still empty
if ( $f_db_type == 'oci8' ) {
$t_db_conn_exists = $t_db_conn_exists || ( $f_database_name == '' && $f_db_username !== '' && $f_hostname !== '' );
}
print_test( 'Checking Database connection settings exist',
$t_db_conn_exists,
true,
'database connection settings do not exist?'
);

print_test( 'Checking PHP support for database type',
db_check_database_support( $f_db_type ), true,
'database is not supported by PHP. Check that it has been compiled into your server.'
Expand Down

0 comments on commit 803446e

Please sign in to comment.