|
|
|
@ -3,6 +3,7 @@ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
============================================================================== |
|
|
|
|
* Chamilo LMS |
|
|
|
|
* This file contains functions used by the install and upgrade scripts. |
|
|
|
|
* |
|
|
|
|
* Ideas for future additions: |
|
|
|
@ -28,6 +29,28 @@ define('SYSTEM_CONFIG_FILENAME', 'configuration.dist.php'); |
|
|
|
|
============================================================================== |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Connecting to the databse server - the common routine. |
|
|
|
|
*/ |
|
|
|
|
function database_server_connect() { |
|
|
|
|
global $dbHostForm, $dbUsernameForm, $dbPassForm; |
|
|
|
|
if (($res = @Database::connect(array('server' => $dbHostForm, 'username' => $dbUsernameForm, 'password' => $dbPassForm))) === false) { |
|
|
|
|
$no = Database::errno(); |
|
|
|
|
$msg = Database::error(); |
|
|
|
|
echo '<hr />#'.$no.': '.$msg.'<hr />'; |
|
|
|
|
echo get_lang('DBServerDoesntWorkOrLoginPassIsWrong').'.<br /><br />'. |
|
|
|
|
get_lang('PleaseCheckTheseValues').' :<br /><br />'. |
|
|
|
|
'<strong>'.get_lang('DBHost').'</strong> : '.$dbHostForm.'<br />'. |
|
|
|
|
'<strong>'.get_lang('DBLogin').'</strong> : '.$dbUsernameForm.'<br />'. |
|
|
|
|
'<strong>'.get_lang('DBPassword').'</strong> : '.$dbPassForm.'<br /><br />'. |
|
|
|
|
get_lang('PleaseGoBackToStep').' '. (defined('SYSTEM_INSTALLATION') ? '3' : '1').'.'. |
|
|
|
|
'<p><button type="submit" class="back" name="step'. (defined('SYSTEM_INSTALLATION') ? '3' : '1').'" value="< '.get_lang('Back').'">'.get_lang('Back').'</button></p>'. |
|
|
|
|
'</td></tr></table></form></body></html>'; |
|
|
|
|
exit (); |
|
|
|
|
} |
|
|
|
|
@Database::query("set session sql_mode='';"); // Disabling special SQL modes (MySQL 5) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* We assume this function is called from install scripts that reside inside the install folder. |
|
|
|
|
*/ |
|
|
|
|