Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added constant for ADOdb minimum version
Modified installer and admin checks page to use the new constant
  • Loading branch information
dregad committed Feb 14, 2014
1 parent 34b961d commit 5981daa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
4 changes: 2 additions & 2 deletions admin/check/check_database_inc.php
Expand Up @@ -51,7 +51,7 @@
# This bug has been fixed in ADOdb 5.11 (May 5, 2010) but we still
# need to use the backwards compatible approach to detect ADOdb <5.11.
if( preg_match( '/^[Vv]([0-9\.]+)/', $ADODB_vers, $t_matches ) == 1 ) {
$t_adodb_version_check_ok = version_compare( $t_matches[1], '5.10', '>=' );
$t_adodb_version_check_ok = version_compare( $t_matches[1], DB_MIN_VERSION_ADODB, '>=' );
$t_adodb_version_info = 'ADOdb version ' . htmlentities( $t_matches[1] ) . ' was found.';
}

Expand All @@ -63,7 +63,7 @@
);
}
check_print_test_row(
'Version of <a href="http://en.wikipedia.org/wiki/ADOdb">ADOdb</a> available is at least 5.11',
'Version of <a href="http://en.wikipedia.org/wiki/ADOdb">ADOdb</a> available is at least ' . DB_MIN_VERSION_ADODB,
$t_adodb_version_check_ok,
$t_adodb_version_info
);
Expand Down
18 changes: 4 additions & 14 deletions admin/install.php
Expand Up @@ -306,21 +306,11 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
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.' );

# ADOdb library version check
# PostgreSQL, Oracle and MSSQL require at least 5.18.
# @TODO dregad 20131001 req is 5.19 actually, but must wait until official release
# MySQL should be fine with 5.10
# PostgreSQL, Oracle and MSSQL require at least 5.19. MySQL should be fine
# with 5.10 but to simplify we align to the requirement of the others.
$t_adodb_version = substr( $ADODB_vers, 1, strpos( $ADODB_vers, ' ' ) - 1 );
switch( $f_db_type ) {
case 'mssqlnative':
case 'oci8' :
case 'pgsql' :
$t_adodb_min = '5.18';
break;
default:
$t_adodb_min = '5.10';
}
print_test( "Checking ADOdb Library version is at least $t_adodb_min",
version_compare( $t_adodb_version, $t_adodb_min, '>=' ),
print_test( "Checking ADOdb Library version is at least " . DB_MIN_VERSION_ADODB,
version_compare( $t_adodb_version, DB_MIN_VERSION_ADODB, '>=' ),
true,
'Current version: ' . $ADODB_vers
);
Expand Down
1 change: 1 addition & 0 deletions core/constant_inc.php
Expand Up @@ -39,6 +39,7 @@

# installation
define( 'CONFIGURED_PASSWORD', "______" );
define( 'DB_MIN_VERSION_ADODB', '5.19dev' ); # For mssql, oracle and pgsql
define( 'DB_MIN_VERSION_MSSQL', '9.0.0' );
define( 'DB_MIN_VERSION_MYSQL', '5.0.8' ); # See #16584
define( 'DB_MIN_VERSION_PGSQL', '8.4' ); # Earliest supported version as of Jan 2014
Expand Down

0 comments on commit 5981daa

Please sign in to comment.