Added investigation means: DB dump from the ITopConsultant page, this feature should not rely on mySQL statements that are not allowed in the OVH hosting setup. The feature is 100% new and does not interfere with any existing code. Therefore I would advise to upgrade the official build as quickly as possible.

SVN:trunk[190]
This commit is contained in:
Romain Quetiez
2009-10-02 15:07:28 +00:00
parent 3b099ddb3a
commit d71df57c66
3 changed files with 97 additions and 0 deletions

View File

@@ -294,6 +294,28 @@ abstract class MetaModel
// This attribute has been inherited (compound objects)
return self::DBGetTable(self::$m_aAttribOrigins[$sClass][$sAttCode]);
}
final static protected function DBEnumTables()
{
// This API do not rely on our capability to query the DB and retrieve
// the list of existing tables
// Rather, it uses the list of expected tables, corresponding to the data model
$aTables = array();
foreach (self::GetClasses() as $sClass)
{
if (self::IsAbstract($sClass)) continue;
$sTable = self::DBGetTable($sClass);
// Could be completed later with all the classes that are using a given table
if (!array_key_exists($sTable, $aTables))
{
$aTables[$sTable] = array();
}
$aTables[$sTable][] = $sClass;
}
return $aTables;
}
final static public function DBGetKey($sClass)
{
self::_check_subclass($sClass);
@@ -1998,6 +2020,17 @@ abstract class MetaModel
// $sDoCreateAll = implode(" ; ", $aSQL);
}
public static function DBDump()
{
$aDataDump = array();
foreach (self::DBEnumTables() as $sTable => $aClasses)
{
$aRows = CMDBSource::DumpTable($sTable);
$aDataDump[$sTable] = $aRows;
}
return $aDataDump;
}
public static function DBCheckFormat()
{
$aErrors = array();