diff options
author | rxu <rxu@mail.ru> | 2017-06-28 00:58:03 +0700 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2018-01-01 13:56:04 +0100 |
commit | f8fbe3793680af1dae2db2829cfc84068831c52f (patch) | |
tree | 54c7108b28fb58688a8695a0b592c163314a09f9 /phpBB/install/convert | |
parent | ff18802656e72981f6ecb613d756bc19f2462689 (diff) | |
download | forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar.gz forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar.bz2 forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar.xz forums-f8fbe3793680af1dae2db2829cfc84068831c52f.zip |
[ticket/14972] replace all occurrences of sizeof() with the count()
PHPBB3-14972
Diffstat (limited to 'phpBB/install/convert')
-rw-r--r-- | phpBB/install/convert/controller/convertor.php | 4 | ||||
-rw-r--r-- | phpBB/install/convert/convertor.php | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/phpBB/install/convert/controller/convertor.php b/phpBB/install/convert/controller/convertor.php index 7b2a00d7b9..3639b10dc5 100644 --- a/phpBB/install/convert/controller/convertor.php +++ b/phpBB/install/convert/controller/convertor.php @@ -537,7 +537,7 @@ class convertor foreach ($prefixes as $prefix => $count) { - if ($count >= sizeof($tables)) + if ($count >= count($tables)) { $possible_prefix = $prefix; break; @@ -730,7 +730,7 @@ class convertor include_once($this->phpbb_root_path . 'install/convertors/' . $entry); if (isset($convertor_data)) { - $sort[strtolower($convertor_data['forum_name'])] = sizeof($convertors); + $sort[strtolower($convertor_data['forum_name'])] = count($convertors); $convertors[] = array( 'tag' => $m[1], diff --git a/phpBB/install/convert/convertor.php b/phpBB/install/convert/convertor.php index f7f05ebdae..5118651b71 100644 --- a/phpBB/install/convert/convertor.php +++ b/phpBB/install/convert/convertor.php @@ -312,9 +312,9 @@ class convertor } } - if (sizeof($bad_folders)) + if (count($bad_folders)) { - $msg = (sizeof($bad_folders) == 1) ? $user->lang['MAKE_FOLDER_WRITABLE'] : $user->lang['MAKE_FOLDERS_WRITABLE']; + $msg = (count($bad_folders) == 1) ? $user->lang['MAKE_FOLDER_WRITABLE'] : $user->lang['MAKE_FOLDERS_WRITABLE']; sort($bad_folders); $this->error(sprintf($msg, implode('<br />', $bad_folders)), __LINE__, __FILE__, true); @@ -371,7 +371,7 @@ class convertor $val = array($val); } - for ($j = 0, $size = sizeof($val); $j < $size; ++$j) + for ($j = 0, $size = count($val); $j < $size; ++$j) { if (preg_match('/LEFT JOIN ([a-z0-9_]+) AS ([a-z0-9_]+)/i', $val[$j], $m)) { @@ -412,11 +412,11 @@ class convertor // Throw an error if some tables are missing // We used to do some guessing here, but since we have a suggestion of possible values earlier, I don't see it adding anything here to do it again - if (sizeof($missing_tables) == sizeof($tables_list)) + if (count($missing_tables) == count($tables_list)) { $this->error($user->lang['NO_TABLES_FOUND'] . ' ' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); } - else if (sizeof($missing_tables)) + else if (count($missing_tables)) { $this->error(sprintf($user->lang['TABLES_MISSING'], implode($user->lang['COMMA_SEPARATOR'], $missing_tables)) . '<br /><br />' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); } @@ -514,7 +514,7 @@ class convertor )); // This loop takes one target table and processes it - while ($current_table < sizeof($convert->convertor['schema'])) + while ($current_table < count($convert->convertor['schema'])) { $schema = $convert->convertor['schema'][$current_table]; @@ -753,7 +753,7 @@ class convertor case 'mysqli': $waiting_rows[] = '(' . implode(', ', $insert_values) . ')'; - if (sizeof($waiting_rows) >= $convert->num_wait_rows) + if (count($waiting_rows) >= $convert->num_wait_rows) { $errored = false; @@ -809,7 +809,7 @@ class convertor $src_db->sql_freeresult($___result); // We might still have some rows waiting - if (sizeof($waiting_rows)) + if (count($waiting_rows)) { $errored = false; $db->sql_return_on_error(true); @@ -888,7 +888,7 @@ class convertor $current_table++; // $percentage = ($skip_rows == 0) ? 0 : floor(100 / ($total_rows / $skip_rows)); - $msg = sprintf($user->lang['STEP_PERCENT_COMPLETED'], $current_table, sizeof($convert->convertor['schema'])); + $msg = sprintf($user->lang['STEP_PERCENT_COMPLETED'], $current_table, count($convert->convertor['schema'])); $this->template->assign_vars(array( 'BODY' => $msg, @@ -1126,7 +1126,7 @@ class convertor } else { - while ($last_statement < sizeof($convert->convertor['execute_last'])) + while ($last_statement < count($convert->convertor['execute_last'])) { // @codingStandardsIgnoreStart eval($convert->convertor['execute_last'][$last_statement]); @@ -1140,8 +1140,8 @@ class convertor $last_statement++; $url = $this->save_convert_progress($converter, 'jump=1&last=' . $last_statement); - $percentage = ($last_statement == 0) ? 0 : floor(100 / (sizeof($convert->convertor['execute_last']) / $last_statement)); - $msg = sprintf($user->lang['STEP_PERCENT_COMPLETED'], $last_statement, sizeof($convert->convertor['execute_last']), $percentage); + $percentage = ($last_statement == 0) ? 0 : floor(100 / (count($convert->convertor['execute_last']) / $last_statement)); + $msg = sprintf($user->lang['STEP_PERCENT_COMPLETED'], $last_statement, count($convert->convertor['execute_last']), $percentage); $this->template->assign_vars(array( 'L_SUBMIT' => $user->lang['CONTINUE_LAST'], |