also fix context in case of restore
This commit is contained in:
@@ -162,7 +162,12 @@ function connection()
|
||||
addMessage(getError(array('Impossible de sélectionner la base de données "'.DB_NAME.'"', 'Changez les constantes dans le fichier "'.SETTINGS_FILE.'" ou réinstaller la base de données'), true));
|
||||
$_GET['page'] = 'install';
|
||||
}
|
||||
|
||||
setContext($oConnection);
|
||||
return $oConnection;
|
||||
}
|
||||
|
||||
function setContext(&$oConnection)
|
||||
{
|
||||
//php settings
|
||||
date_default_timezone_set(TIMEZONE);
|
||||
ini_set('default_charset', TEXT_ENC);
|
||||
@@ -185,8 +190,6 @@ function connection()
|
||||
$iMins -= $iHours * 60;
|
||||
$sOffset = sprintf('%+d:%02d', $iHours*$iSign, $iMins);
|
||||
setQuery("SET time_zone='{$sOffset}';");
|
||||
|
||||
return $oConnection;
|
||||
}
|
||||
|
||||
function getTables()
|
||||
@@ -488,6 +491,7 @@ function restoreBackUp($sBackFilePath, &$oConnection)
|
||||
$sFileContents = file_get_contents($sBackFilePath);
|
||||
mysql_close($oConnection);
|
||||
$oConnection = mysql_connect(DB_SERVER, DB_LOGIN, DB_PASS);
|
||||
setContext($oConnection);
|
||||
$asQueries = array_filter(explode(END_OF_QUERY, str_replace(array("\r\n", "\n"), '', $sFileContents)));
|
||||
foreach($asQueries as $sQuery)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user