Index: trunk/core/kernel/db/db_connection.php =================================================================== diff -u -N -r7855 -r7991 --- trunk/core/kernel/db/db_connection.php (.../db_connection.php) (revision 7855) +++ trunk/core/kernel/db/db_connection.php (.../db_connection.php) (revision 7991) @@ -573,5 +573,26 @@ return $this->ChangeQuery($sql); } + + /** + * Allows to detect table's presense in database + * + * @param string $table_name + * @return bool + */ + function TableFound($table_name) + { + static $table_found = Array(); + + if (!preg_match('/^'.preg_quote(TABLE_PREFIX, '/').'(.*)/', $table_name)) { + $table_name = TABLE_PREFIX.$table_name; + } + + if (!isset($table_found[$table_name])) { + $table_found[$table_name] = $this->Query('SHOW TABLES LIKE "'.$table_name.'"'); + } + + return $table_found[$table_name]; + } } ?> \ No newline at end of file