Hi,
i have written a fail over for loading the desired extension,
should i check in this now, or should i wait for 2.7.1 ?
if selected extension it trys the other extension, and prints an error message on main.php, but works, elsewise it redirects to error.php
(also minor changes in main.php and dbi/*)
in database_interface.lib.php:
/** * Loads the mysql extensions if it is not loaded yet * * @param string $extension mysql extension to load */ function PMA_DBI_checkAndLoadMysqlExtension( $extension = 'mysql' ) { if ( ! function_exists( $extension . '_connect' ) ) { PMA_dl( $extension ); // check whether mysql is available if ( ! function_exists( $extension . '_connect' ) ) { return false; } }
return true; }
/** * check for requested extension */ if ( ! PMA_DBI_checkAndLoadMysqlExtension( $GLOBALS['cfg']['Server']['extension'] ) ) {
// if it fails try alternative extension ... // and display an error ...
// TODO 2.7.1: add different messages for alternativ extension // and complete fail (no alternativ extension too) $GLOBALS['errors'][] = sprintf($GLOBALS['strCantLoad'], $GLOBALS['cfg']['Server']['extension']) . '<br />' . "\n" .'<a href="./Documentation.html#faqmysql" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n";
if ( $GLOBALS['cfg']['Server']['extension'] === 'mysql' ) { $alternativ_extension = 'mysqli'; } else { $alternativ_extension = 'mysql'; }
if ( ! PMA_DBI_checkAndLoadMysqlExtension( $alternativ_extension ) ) { // if alternativ fails too ... header( 'Location: error.php' . '?lang=' . urlencode( $available_languages[$lang][2] ) . '&char=' . urlencode( $charset ) . '&dir=' . urlencode( $text_dir ) . '&type=' . urlencode( $strError ) . '&error=' . urlencode( sprintf( $GLOBALS['strCantLoad'], $GLOBALS['cfg']['Server']['extension'] ) .' - [a@./Documentation.html#faqmysql@documentation]' .$GLOBALS['strDocu'] . '[/a]' ) . '&' . SID ); exit(); }
$GLOBALS['cfg']['Server']['extension'] = $alternativ_extension; }
Hi Sebastian, you can commit now. Then, let's discuss the roadmap for -rc1 :)
Marc
Sebastian Mendel a écrit :
Hi,
i have written a fail over for loading the desired extension,
should i check in this now, or should i wait for 2.7.1 ?
if selected extension it trys the other extension, and prints an error message on main.php, but works, elsewise it redirects to error.php
(also minor changes in main.php and dbi/*)
in database_interface.lib.php:
/**
- Loads the mysql extensions if it is not loaded yet
- @param string $extension mysql extension to load
*/ function PMA_DBI_checkAndLoadMysqlExtension( $extension = 'mysql' ) { if ( ! function_exists( $extension . '_connect' ) ) { PMA_dl( $extension ); // check whether mysql is available if ( ! function_exists( $extension . '_connect' ) ) { return false; } }
return true;
}
/**
- check for requested extension
*/ if ( ! PMA_DBI_checkAndLoadMysqlExtension( $GLOBALS['cfg']['Server']['extension'] ) ) {
// if it fails try alternative extension ... // and display an error ... // TODO 2.7.1: add different messages for alternativ extension // and complete fail (no alternativ extension too) $GLOBALS['errors'][] = sprintf($GLOBALS['strCantLoad'],
$GLOBALS['cfg']['Server']['extension']) . '<br />' . "\n" .'<a href="./Documentation.html#faqmysql" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n";
if ( $GLOBALS['cfg']['Server']['extension'] === 'mysql' ) { $alternativ_extension = 'mysqli'; } else { $alternativ_extension = 'mysql'; } if ( ! PMA_DBI_checkAndLoadMysqlExtension( $alternativ_extension ) ) { // if alternativ fails too ... header( 'Location: error.php' . '?lang=' . urlencode( $available_languages[$lang][2] ) . '&char=' . urlencode( $charset ) . '&dir=' . urlencode( $text_dir ) . '&type=' . urlencode( $strError ) . '&error=' . urlencode( sprintf( $GLOBALS['strCantLoad'], $GLOBALS['cfg']['Server']['extension'] ) .' - [a@./Documentation.html#faqmysql@documentation]' .$GLOBALS['strDocu'] . '[/a]' ) . '&' . SID ); exit(); } $GLOBALS['cfg']['Server']['extension'] = $alternativ_extension;
}
Marc Delisle a écrit :
Hi Sebastian, you can commit now.
merci thats fine, makes live easier for developers when switching php versions ... ;-)
but not before 8 am (in about 9 hours), cause i have this changes not at my present location ...
Then, let's discuss the roadmap for -rc1 :)
ok
-- sebastian