[ticket/634] Remove unused sql_table_exists() function
B3P-634
This commit is contained in:
@@ -236,29 +236,6 @@ function generate_portal_pagination($base_url, $num_items, $per_page, $start_ite
|
|||||||
return $page_string;
|
return $page_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if table exists
|
|
||||||
* @copyright (c) 2007 phpBB Group
|
|
||||||
*
|
|
||||||
* @param string $table_name The table name to check for
|
|
||||||
* @return bool true if table exists, else false
|
|
||||||
*/
|
|
||||||
function sql_table_exists($table_name)
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
$db->sql_return_on_error(true);
|
|
||||||
$result = $db->sql_query_limit('SELECT * FROM ' . $db->sql_escape($table_name), 1);
|
|
||||||
$db->sql_return_on_error(false);
|
|
||||||
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get topic tracking info for news
|
* get topic tracking info for news
|
||||||
* based on get_complete_tracking_info of phpBB3
|
* based on get_complete_tracking_info of phpBB3
|
||||||
|
|||||||
@@ -31,23 +31,6 @@ class phpbb_unit_functions_functions_test extends \board3\portal\tests\testframe
|
|||||||
->will($this->returnValue(array('match' => array('/disallowed_word/'), 'replace' => array(''))));
|
->will($this->returnValue(array('match' => array('/disallowed_word/'), 'replace' => array(''))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function data_sql_table_exists()
|
|
||||||
{
|
|
||||||
return array(
|
|
||||||
array(true, 'phpbb_config'),
|
|
||||||
array(true, 'phpbb_styles'),
|
|
||||||
array(false, 'phpbb_foobar'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @dataProvider data_sql_table_exists
|
|
||||||
*/
|
|
||||||
public function test_sql_table_exists($expected, $table)
|
|
||||||
{
|
|
||||||
$this->assertEquals($expected, sql_table_exists($table));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function data_character_limit()
|
public function data_character_limit()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
Reference in New Issue
Block a user