mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
fixed since r38811 not working restore of backups
This commit is contained in:
parent
15c9fd0d32
commit
d85cffb5e8
@ -479,11 +479,6 @@ class db_backup
|
|||||||
{
|
{
|
||||||
$GLOBALS['egw_setup']->translation->setup_translation_sql();
|
$GLOBALS['egw_setup']->translation->setup_translation_sql();
|
||||||
}
|
}
|
||||||
$translation =& $GLOBALS['egw_setup']->translation->sql;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$translation =& $GLOBALS['egw']->translation;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($table) // do we already reached the data part
|
if ($table) // do we already reached the data part
|
||||||
@ -506,9 +501,9 @@ class db_backup
|
|||||||
{
|
{
|
||||||
if ($convert_to_system_charset && !$this->db->capabilities['client_encoding'])
|
if ($convert_to_system_charset && !$this->db->capabilities['client_encoding'])
|
||||||
{
|
{
|
||||||
$translation->convert($data,$charset);
|
$data = translation::convert($data,$charset);
|
||||||
}
|
}
|
||||||
$this->db->insert($table,$data,False,__LINE__,__FILE__,'all-apps',true);
|
$this->db->insert($table,$data,False,__LINE__,__FILE__,true,true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1631,15 +1631,15 @@ class egw_db
|
|||||||
*
|
*
|
||||||
* @author RalfBecker<at>outdoor-training.de
|
* @author RalfBecker<at>outdoor-training.de
|
||||||
*
|
*
|
||||||
* @param bool/string $app name of the app or default False to use the app set by db::set_app or the current app,
|
* @param bool|string $app name of the app or default False to use the app set by db::set_app or the current app,
|
||||||
* true to search the already loaded table-definitions for $table
|
* true to search the already loaded table-definitions for $table and then search all existing apps for it
|
||||||
* @param bool/string $table if set return only defintions of that table, else return all defintions
|
* @param bool|string $table if set return only defintions of that table, else return all defintions
|
||||||
* @return mixed array with table-defintions or False if file not found
|
* @return mixed array with table-defintions or False if file not found
|
||||||
*/
|
*/
|
||||||
function get_table_definitions($app=False,$table=False)
|
function get_table_definitions($app=False,$table=False)
|
||||||
{
|
{
|
||||||
static $all_app_data;
|
static $all_app_data = array();
|
||||||
if ($app === true && $table && isset($all_app_data))
|
if ($app === true && $table)
|
||||||
{
|
{
|
||||||
foreach($all_app_data as $app => &$app_data)
|
foreach($all_app_data as $app => &$app_data)
|
||||||
{
|
{
|
||||||
@ -1648,6 +1648,30 @@ class egw_db
|
|||||||
return $app_data[$table];
|
return $app_data[$table];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// $table not found in loaded apps, check not yet loaded ones
|
||||||
|
foreach(scandir(EGW_INCLUDE_ROOT) as $app)
|
||||||
|
{
|
||||||
|
if ($app[0] == '.' || !is_dir(EGW_INCLUDE_ROOT.'/'.$app) || isset($all_app_data[$app]))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$tables_current = EGW_INCLUDE_ROOT . "/$app/setup/tables_current.inc.php";
|
||||||
|
if (!@file_exists($tables_current))
|
||||||
|
{
|
||||||
|
$all_app_data[$app] = False;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
include($tables_current);
|
||||||
|
$all_app_data[$app] =& $phpgw_baseline;
|
||||||
|
unset($phpgw_baseline);
|
||||||
|
|
||||||
|
if (isset($all_app_data[$app][$table]))
|
||||||
|
{
|
||||||
|
return $all_app_data[$app][$table];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$app = false;
|
$app = false;
|
||||||
}
|
}
|
||||||
if (!$app)
|
if (!$app)
|
||||||
|
Loading…
Reference in New Issue
Block a user