1
0
mirror of https://github.com/e107inc/e107.git synced 2025-05-04 03:16:23 +02:00

Notice removal

This commit is contained in:
e107steved 2011-12-27 12:00:55 +00:00
parent 383b54d375
commit efc558af51

View File

@ -1681,25 +1681,28 @@ class e_db_mysql
protected function loadTableDef($defFile, $tableName)
{
$result = FALSE;
// Read the file using the array handler routines
// File structure is a nested array - first level is table name, second level is either FALSE (for do nothing) or array(_FIELD_DEFS => array(), _NOTNULL => array())
$temp = file_get_contents($defFile);
// Strip any comments (only /*...*/ supported)
$temp = preg_replace("#\/\*.*?\*\/#mis", '', $temp);
//echo "Check: {$defFile}, {$tableName}<br />";
if ($temp !== FALSE)
if (is_readable($defFile))
{
$array = e107::getArrayStorage();
$typeDefs = $array->ReadArray($temp);
unset($temp);
if (isset($typeDefs[$tableName]))
// Read the file using the array handler routines
// File structure is a nested array - first level is table name, second level is either FALSE (for do nothing) or array(_FIELD_DEFS => array(), _NOTNULL => array())
$temp = file_get_contents($defFile);
// Strip any comments (only /*...*/ supported)
$temp = preg_replace("#\/\*.*?\*\/#mis", '', $temp);
//echo "Check: {$defFile}, {$tableName}<br />";
if ($temp !== FALSE)
{
$this->dbFieldDefs[$tableName] = $typeDefs[$tableName];
$fileData = $array->WriteArray($typeDefs[$tableName], FALSE);
if (FALSE === file_put_contents(e_CACHE_DB.$tableName.'.php', $fileData))
{ // Could do something with error - but mustn't return FALSE - would trigger auto-generated structure
$array = e107::getArrayStorage();
$typeDefs = $array->ReadArray($temp);
unset($temp);
if (isset($typeDefs[$tableName]))
{
$this->dbFieldDefs[$tableName] = $typeDefs[$tableName];
$fileData = $array->WriteArray($typeDefs[$tableName], FALSE);
if (FALSE === file_put_contents(e_CACHE_DB.$tableName.'.php', $fileData))
{ // Could do something with error - but mustn't return FALSE - would trigger auto-generated structure
}
$result = TRUE;
}
$result = TRUE;
}
}