mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 11:44:08 +02:00
[ticket/14972] replace all occurrences of sizeof() with the count()
PHPBB3-14972
This commit is contained in:
@@ -372,7 +372,7 @@ class database
|
||||
$tables = array_map('strtolower', $tables);
|
||||
$table_intersect = array_intersect($tables, $table_ary);
|
||||
|
||||
if (sizeof($table_intersect))
|
||||
if (count($table_intersect))
|
||||
{
|
||||
$errors[] = array(
|
||||
'title' => 'INST_ERR_PREFIX',
|
||||
|
@@ -202,7 +202,7 @@ class ajax_iohandler extends iohandler_base
|
||||
|
||||
if (in_array($input_options['type'], array('select', 'radio'), true))
|
||||
{
|
||||
for ($i = 0, $total = sizeof($input_options['options']); $i < $total; $i++)
|
||||
for ($i = 0, $total = count($input_options['options']); $i < $total; $i++)
|
||||
{
|
||||
if (isset($input_options['options'][$i]['label']))
|
||||
{
|
||||
@@ -369,7 +369,7 @@ class ajax_iohandler extends iohandler_base
|
||||
*/
|
||||
public function set_active_stage_menu($menu_path)
|
||||
{
|
||||
$this->nav_data['active'] = $menu_path[sizeof($menu_path) - 1];
|
||||
$this->nav_data['active'] = $menu_path[count($menu_path) - 1];
|
||||
$this->send_response();
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ class ajax_iohandler extends iohandler_base
|
||||
*/
|
||||
public function set_finished_stage_menu($menu_path)
|
||||
{
|
||||
$this->nav_data['finished'][] = $menu_path[sizeof($menu_path) - 1];
|
||||
$this->nav_data['finished'][] = $menu_path[count($menu_path) - 1];
|
||||
$this->send_response();
|
||||
}
|
||||
|
||||
|
@@ -239,7 +239,7 @@ class add_bots extends \phpbb\install\task_base
|
||||
|
||||
$this->install_config->set('add_bot_index', $i);
|
||||
|
||||
if ($i < sizeof($this->bot_list))
|
||||
if ($i < count($this->bot_list))
|
||||
{
|
||||
throw new resource_limit_reached_exception();
|
||||
}
|
||||
|
@@ -169,7 +169,7 @@ class add_modules extends \phpbb\install\task_base
|
||||
$this->db->sql_return_on_error(true);
|
||||
|
||||
$module_classes = array('acp', 'mcp', 'ucp');
|
||||
$total = sizeof($module_classes);
|
||||
$total = count($module_classes);
|
||||
$i = $this->config->get('module_class_index', 0);
|
||||
$module_classes = array_slice($module_classes, $i);
|
||||
|
||||
|
@@ -327,7 +327,7 @@ class add_config_settings extends \phpbb\install\task_base
|
||||
}
|
||||
|
||||
$i = $this->install_config->get('add_config_settings_index', 0);
|
||||
$total = sizeof($sql_ary);
|
||||
$total = count($sql_ary);
|
||||
$sql_ary = array_slice($sql_ary, $i);
|
||||
|
||||
foreach ($sql_ary as $sql)
|
||||
|
@@ -99,7 +99,7 @@ class add_default_data extends \phpbb\install\task_base
|
||||
$sql_query = $this->database_helper->split_sql_file($sql_query, $dbms_info[$dbms]['DELIM']);
|
||||
|
||||
$i = $this->config->get('add_default_data_index', 0);
|
||||
$total = sizeof($sql_query);
|
||||
$total = count($sql_query);
|
||||
$sql_query = array_slice($sql_query, $i);
|
||||
|
||||
foreach ($sql_query as $sql)
|
||||
|
@@ -101,7 +101,7 @@ class add_tables extends \phpbb\install\task_base
|
||||
|
||||
$db_table_schema = @file_get_contents($this->schema_file_path);
|
||||
$db_table_schema = json_decode($db_table_schema, true);
|
||||
$total = sizeof($db_table_schema);
|
||||
$total = count($db_table_schema);
|
||||
$i = $this->config->get('add_table_index', 0);
|
||||
$db_table_schema = array_slice($db_table_schema, $i);
|
||||
|
||||
|
@@ -149,7 +149,7 @@ class install_extensions extends \phpbb\install\task_base
|
||||
|
||||
$this->install_config->set('install_extensions_index', $i);
|
||||
|
||||
if ($i < sizeof($all_available_extensions))
|
||||
if ($i < count($all_available_extensions))
|
||||
{
|
||||
throw new resource_limit_reached_exception();
|
||||
}
|
||||
|
@@ -206,7 +206,7 @@ class update_extensions extends task_base
|
||||
|
||||
$this->install_config->set('update_extensions_index', $i);
|
||||
|
||||
if ($i < sizeof($all_available_extensions))
|
||||
if ($i < count($all_available_extensions))
|
||||
{
|
||||
throw new resource_limit_reached_exception();
|
||||
}
|
||||
|
@@ -145,7 +145,7 @@ class diff_files extends task_base
|
||||
{
|
||||
$file_contents[] = file_get_contents($file_to_diff);
|
||||
|
||||
if ($file_contents[sizeof($file_contents) - 1] === false)
|
||||
if ($file_contents[count($file_contents) - 1] === false)
|
||||
{
|
||||
$this->iohandler->add_error_message(array('FILE_DIFFER_ERROR_FILE_CANNOT_BE_READ', $files_to_diff));
|
||||
unset($file_contents);
|
||||
|
Reference in New Issue
Block a user