From 3121baf3b109bff164c869740bee7e78e4fe5c4d Mon Sep 17 00:00:00 2001 From: filip Date: Wed, 30 Jul 2014 17:23:04 +0200 Subject: refactoring of www.mageia.org translation report for better usability --- langs/report_test.php | 603 +++++++++++++++++++++++++++++--------------------- 1 file changed, 348 insertions(+), 255 deletions(-) (limited to 'langs/report_test.php') diff --git a/langs/report_test.php b/langs/report_test.php index b07186410..0dab6390b 100644 --- a/langs/report_test.php +++ b/langs/report_test.php @@ -5,25 +5,26 @@ www.mageia.org translation report @@ -35,9 +36,7 @@
$value) { + $current_key = $key; + if ($needle === $value OR (is_array($value) && recursive_array_search($needle, $value) !== FALSE)) { + return $current_key; + } + } + return FALSE; + } + include 'lib.php'; - $times[] = time_debug('lib.php'); - $one_language = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null; - $one_resource = isset($_GET['r']) ? strip_tags(trim($_GET['r'])) : null; + $one_language = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : NULL; + $one_resource = isset($_GET['r']) ? strip_tags(trim($_GET['r'])) : NULL; - $restore_languages = FALSE; - $restore_resources = FALSE; + $one_language_all_resources = FALSE; + $all_languages_only_one_resource = FALSE; if (isset($one_language) && $one_language != 'all') { + $one_language_all_resources = TRUE; $otherLangs = array('en', $one_language); - $restore_languages = TRUE; } else { $otherLangs = get_other_langs(); } - $times[] = time_debug('get_other_langs'); if (isset($one_resource) && $one_resource != 'all') { - $enFiles = array($one_resource); - $restore_resources = TRUE; + $all_languages_only_one_resource = TRUE; + $enFiles = array($one_resource); } else { - $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file - sort($enFiles); + $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file } $num_of_enFiles = count($enFiles); - $times[] = time_debug('num_of_enFiles'); - $enStringsCount = array(); - $report = array(); - $stats = array(); - $stats['en']['files'] = 0; - $num_of_col = 0; + $report = array(); + $ok_link = '
%s file
'; + $diff_link = '
%s'; + $add_trans = ''; - $diff_link = ''; - - $languages = array(); $unique_lines_in_eng_constitution = array(); $number_of_unique_lines_in_eng_constitution = 0; foreach ($otherLangs as $l) { - - $stats['en']['files'] += 1; - $stats[$l]['files'] = 0; - $stats[$l]['strings'] = 0; - if ($l == 'en' || $restore_languages) { - $link_one_language = '%s'; - } else { - $link_one_language = '%s'; - } - - $s = sprintf('' . $link_one_language . '
%s', - $langs[$l], $l); - - $cols = ''; - $lang_coloumn = ''; - foreach ($enFiles as $f) { - + $references = ''; + $page_not_linked = ''; + $old_page = ''; $resource = _extract_resource($f); + $resource_filename = str_replace('index', '', $resource); + $mga = array('view page' => $resource_filename); $langF = _po_file_switch($f, $l); - $enStringsCount[$f] = 0; - if (false !== strstr($f, '../_nav/langs/en.')) { - $nav = true; - $langF = '../_nav/langs/' . $l . '.po' . (($l == 'en') ? 't' : ''); - } else { - $nav = false; - } - - $link = str_replace('index', '', $resource); - if ($nav) { + if (strstr($f, '../_nav/langs/en.') !== FALSE) { + $nav = TRUE; $dest_en = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', 'en.pot'); $dest_l = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', $l . '.po'); + $langF = '../_nav/langs/' . $l . '.po' . (($l == 'en') ? 't' : ''); } else { - $dest_en = sprintf('%s/%s/%s/%s', G_APP_ROOT, 'en', $link, 'index.php'); - $dest_l = sprintf('%s/%s/%s/%s', G_APP_ROOT, $l, $link, 'index.php'); + $nav = FALSE; + $dest_en = sprintf('%s/%s/%s/%s', G_APP_ROOT, 'en', $resource_filename, 'index.php'); + $dest_l = sprintf('%s/%s/%s/%s', G_APP_ROOT, $l, $resource_filename, 'index.php'); } - $times[] = time_debug('pre realpath ' . $f); // if symlink e.g. does directly translated page exist? - if ((realpath($dest_l) == realpath($dest_en)) || $nav) { - $page_not_linked = ''; - $old_page = ''; - } else { - $page_not_linked = sprintf('old page still exists!', $l, $link); - $old_page = sprintf('by recycling old page', $l, $link); + if ((realpath($dest_l) != realpath($dest_en)) && !$nav) { + $page_not_linked = sprintf('old page still exists!', $l, $resource_filename); + $old_page = sprintf(' by recycling old page', $l, $resource_filename); } - $times[] = time_debug('post realpath'); - - $add_translation = sprintf('add translation%s', - $f, $l, $old_page - ); + $add_new_translation = sprintf($add_trans, $f, $l, $old_page); if (file_exists($langF)) { - - $times[] = time_debug('file_exists'); - $stats[$l]['files'] += 1; $test = _po_diff($l, $resource); $num_of_fuzzy_or_missing_strings = count($test['fuzzy_or_missing']); - $times[] = time_debug('_diff ' . $l . ' '. $f); $num_of_untranslated_strings = count($test['notrans']); - if ($link == 'about/constitution') { - $constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, $l, $unique_lines_in_eng_constitution); - if ($l == 'en') { - $unique_lines_in_eng_constitution = $constitution_results['unique_lines_in_constitution']; - $number_of_unique_lines_in_eng_constitution = count($unique_lines_in_eng_constitution); - } - $test['a'] += $number_of_unique_lines_in_eng_constitution; // add aproximate number of lines from constitution to translate - $num_of_untranslated_strings += $constitution_results['aproximate_number_of_untranslated_lines']; - } - $times[] = time_debug('aproximate_number_of_untranslated_constitution_lines'); - if ($link == 'about/license') { - require_once('../en/about/license/license.php'); - $times[] = time_debug('require_once ' . $l); - $license_numbers = load_license_numbers($l, true); - $test['a'] += $license_numbers["all"]; // add aproximate number of untranslated sentences from license - $num_of_untranslated_strings += $license_numbers["untran"]; // add number of all license sentences - } - $times[] = time_debug('read_license_from_vcs ' . $l); - if ($nav) { - $mga = array(); - } else if ($link == 'downloads/get') { + $mga = array('see navigation' => ''); + } else if ($resource_filename == 'downloads/get') { $mga = array( - 'A' => 'downloads/get/index.php?q=Mageia-2-dual-CD.iso&d=1', // " style="display: block; + 'view page A' => 'downloads/get/index.php?q=Mageia-2-dual-CD.iso&d=1', 'B' => 'downloads/get/index.php?q=Non_existing_file&d=1', ); - } else if ($link == '2') { + } else if ($resource_filename == '2') { $mga = array( - 'A' => '2/index.php', + 'view page A' => '2/index.php', 'B' => '2/download_index.php', 'C' => '2/for-pc/index.php', 'D' => '2/for-server/index.php', ); - } else if ($link == '3') { + } else if ($resource_filename == '3') { $mga = array( - 'A' => '3/index.php', + 'view page A' => '3/index.php', 'B' => '3/download_index.php', 'C' => '3/for-pc/index.php', 'D' => '3/for-server/index.php', ); - } else if ($link == '4') { + } else if ($resource_filename == '4') { $mga = array( - 'A' => '4/index.php', + 'view page A' => '4/index.php', 'B' => '4/download_index.php', ); - } else if ($link == 'cauldron') { + } else if ($resource_filename == 'cauldron') { + $mga = array('view page' => '5/download_index.php'); + } else if ($resource_filename == 'documentation') { $mga = array( - 'view page' => '5/download_index.php', - ); - } else if ($link == 'documentation') { - $mga = array( - 'doc' => 'doc/index.php', + 'view page doc' => 'doc/index.php', 'archive' => 'doc/archive.php', ); - } else { - $mga = array( - 'view page' => $link, - ); + } else if ($resource_filename == 'about/constitution') { + $constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, $l, $unique_lines_in_eng_constitution); + if ($l == 'en') { + $unique_lines_in_eng_constitution = $constitution_results['unique_lines_in_constitution']; + $number_of_unique_lines_in_eng_constitution = count($unique_lines_in_eng_constitution); + } + $test['a'] += $number_of_unique_lines_in_eng_constitution; // add aproximate number of lines from constitution to translate + $num_of_untranslated_strings += $constitution_results['aproximate_number_of_untranslated_lines']; + } else if ($resource_filename == 'about/license') { + require_once('../en/about/license/license.php'); + $license_numbers = load_license_numbers($l, TRUE); + if ($l == 'en') { + $number_of_unique_lines_in_eng_license = $license_numbers["all"]; + } + $test['a'] += $license_numbers["all"]; // add aproximate number of untranslated sentences from license + $num_of_untranslated_strings += $license_numbers["untran"]; // add number of all license sentences } - $link = '
'; + $link = ''; foreach ($mga as $k => $v) { - $link .= sprintf('%s', $l, $v, $k); + $link .= sprintf('%s', $l, $v, $k); } - $link .= $page_not_linked . '
'; + $link .= $page_not_linked; // . '
'; - if ($num_of_fuzzy_or_missing_strings === 0 - && $num_of_untranslated_strings === 0) { - $cols .= sprintf('OK%s', - $langF, $link); - $done = $test['a']; + if ($num_of_fuzzy_or_missing_strings === 0 && $num_of_untranslated_strings === 0) { + $references .= sprintf($ok_link, $link, $langF); } else { - // special case, en - if ($l == 'en') { - $cols .= '' . $num_of_untranslated_strings . ' strings'; - $enStringsCount[$f] += $test['a']; - $done = $test['a']; - - // regular case - } else { - - if(($num_of_fuzzy_or_missing_strings + $num_of_untranslated_strings) < $test['a']) { - $cols .= sprintf('' . $diff_link, $f, $l); - - if ($num_of_fuzzy_or_missing_strings > 0) { - $cols .= $num_of_fuzzy_or_missing_strings . ' fuzzy or missing
'; - } - if ($num_of_untranslated_strings > 0) { - $cols .= $num_of_untranslated_strings . ' untranslated
'; - } - $cols .= ''; - $cols .= $link . ''; - } else { - $cols .= $add_translation; + if(($num_of_fuzzy_or_missing_strings + $num_of_untranslated_strings) < $test['a']) { + $references .= sprintf($diff_link, $link, $f, $l); + $fuzzy = FALSE; + if ($num_of_fuzzy_or_missing_strings > 0) { + $references .= $num_of_fuzzy_or_missing_strings . ' fuzzy or missing'; + $fuzzy = TRUE; + } + if ($num_of_untranslated_strings > 0) { + $references .= ($fuzzy ? ', ' : '') . $num_of_untranslated_strings . ' untranslated'; } - $done = $test['a'] - $num_of_untranslated_strings - $num_of_fuzzy_or_missing_strings; + $references .= '
'; + } else { + $references .= $add_new_translation; } } - $stats[$l]['strings'] += $done; - - } else { - $cols .= $add_translation; - } - $num_clmns_to_repeat = 9; - $num_of_col++; - if ($num_of_col % $num_clmns_to_repeat == 0 && $num_of_col <= $num_of_enFiles - ($num_clmns_to_repeat / 3)) { - if ($l == 'en') { - $cols .= $lang_coloumn = 'Language'; - } else { - $cols .= $lang_coloumn = sprintf('' . $link_one_language . '
%s', $langs[$l], $l); + } else { // file $langF doesn't exists + $references .= $add_new_translation; + $test = _po_diff('en', $resource); + $num_of_fuzzy_or_missing_strings = 0; + $num_of_untranslated_strings = count($test['notrans']); + if ($resource_filename == 'about/constitution') { // add aproximate number of all lines from constitution + $test['a'] += $number_of_unique_lines_in_eng_constitution; + $num_of_untranslated_strings += $number_of_unique_lines_in_eng_constitution; + } + if ($resource_filename == 'about/license') { // add number of all license sentences + $test['a'] += $number_of_unique_lines_in_eng_license; + $num_of_untranslated_strings += $number_of_unique_lines_in_eng_license; } } - } - $cols .= $lang_coloumn; // last coloumn - $num_of_col = 0; // reset counter of coloumns - - $times[] = time_debug('progress'); - $progress = floor($stats[$l]['strings'] / $stats['en']['strings'] * 100); - // special case, en - if ($l == 'en') { - $s .= sprintf('%d strings', $stats[$l]['strings']); - // regular case - } else { - $s .= sprintf( - '%d%%
%d / %d', - $progress, - $stats[$l]['strings'], - $stats['en']['strings'] + $report[] = array( + 'language' => $l, + 'resource_filename' => $f, + 'num_of_all_strings' => $test['a'], + 'num_of_fuzzy_or_missing_strings' => $num_of_fuzzy_or_missing_strings, + 'num_of_untranslated_strings' => $num_of_untranslated_strings, + 'references' => $references, ); } - $s .= $cols; - $s .= '' . PHP_EOL; - $languages[$stats[$l]['strings'] . '-' . $l] = $s; } - $en_language = array_shift($languages); // shift English for proper sorting - krsort($languages, SORT_NUMERIC); - $times[] = time_debug('krsort'); - - // add language coloumn repeating - $lang_line = array(); - $num_of_h_col = 0; - $add_last_coloumn = FALSE; - $resources = ($restore_resources ? ' ' : $num_of_enFiles . ' resources'); - foreach ($enFiles as $lang_chunk) { - $num_of_h_col++; - if ($restore_resources) { - $lang_line[] = str_replace('en/', '', $lang_chunk); - } else { - $lang_line[] = '' . str_replace('en/', '', $lang_chunk) . ''; + + $total_num_of_strings = 0; // total of all source strings + $language_summary = array(); + $resource_summary = array(); + foreach ($report as $resource_data) { + if ($resource_data['language'] == 'en') { + $total_num_of_strings += $resource_data['num_of_all_strings']; } - if ($num_of_h_col % $num_clmns_to_repeat == 0 && $num_of_h_col <= $num_of_enFiles - ($num_clmns_to_repeat / 3)) { - $lang_line[] = $resources; - $add_last_coloumn = TRUE; + // don't add if there is a need to store languages only for one resource + if(!$all_languages_only_one_resource || $resource_data['resource_filename'] == $one_resource) { + $key_exists = recursive_array_search($resource_data['language'], $language_summary); // is language already in the $language_summary array? + if($resource_data['resource_filename'] == $one_resource) { + $temp_var[0]['language'] = $resource_data['language']; + $temp_var[0]['num_of_all_strings'] = $resource_data['num_of_all_strings']; + $temp_var[0]['num_of_fuzzy_or_missing_strings'] = $resource_data['num_of_fuzzy_or_missing_strings']; + $temp_var[0]['num_of_untranslated_strings'] = $resource_data['num_of_untranslated_strings']; + $temp_var[0]['references'] = $resource_data['references']; + $language_summary[] = $temp_var[0]; + unset($temp_var[0]); // clear var + } else { + if ($key_exists !== FALSE) { + $language_summary[$key_exists]['num_of_all_strings'] += $resource_data['num_of_all_strings']; + $language_summary[$key_exists]['num_of_fuzzy_or_missing_strings'] += $resource_data['num_of_fuzzy_or_missing_strings']; + $language_summary[$key_exists]['num_of_untranslated_strings'] += $resource_data['num_of_untranslated_strings']; + } else { + if($key_exists === FALSE) { + $key_exists = count($language_summary); + } + $language_summary[$key_exists]['language'] = $resource_data['language']; + $language_summary[$key_exists]['num_of_all_strings'] = $resource_data['num_of_all_strings']; + $language_summary[$key_exists]['num_of_fuzzy_or_missing_strings'] = $resource_data['num_of_fuzzy_or_missing_strings']; + $language_summary[$key_exists]['num_of_untranslated_strings'] = $resource_data['num_of_untranslated_strings']; + $language_summary[$key_exists]['references'] = $resource_data['references']; + } + } + } + + // don't add if there is a need to store resources only for one language + if(!$one_language_all_resources || ($resource_data['language'] == $one_language || $resource_data['language'] == 'en')) { + $key_exists = recursive_array_search($resource_data['resource_filename'], $resource_summary); // is resource already in the $resource_summary array? + if($resource_data['language'] == 'en') { + $temp_var[0]['resource_filename'] = $resource_data['resource_filename']; + $temp_var[0]['num_of_all_strings'] = $resource_data['num_of_all_strings']; + $temp_var[0]['num_of_fuzzy_or_missing_strings'] = $resource_data['num_of_fuzzy_or_missing_strings']; + $temp_var[0]['num_of_untranslated_strings'] = $resource_data['num_of_untranslated_strings']; + $temp_var[0]['references'] = $resource_data['references']; + $resource_summary[] = $temp_var[0]; + unset($temp_var[0]); // clear var + } else { + if($one_language_all_resources) { + if($key_exists === FALSE) { + $key_exists = count($resource_summary); + } + $resource_summary[$key_exists]['num_of_fuzzy_or_missing_strings'] = $resource_data['num_of_fuzzy_or_missing_strings']; + $resource_summary[$key_exists]['num_of_untranslated_strings'] = $resource_data['num_of_untranslated_strings']; + $resource_summary[$key_exists]['references'] = $resource_data['references']; + } else if ($key_exists !== FALSE) { + $resource_summary[$key_exists]['num_of_all_strings'] += $resource_data['num_of_all_strings']; + $resource_summary[$key_exists]['num_of_fuzzy_or_missing_strings'] += $resource_data['num_of_fuzzy_or_missing_strings']; + $resource_summary[$key_exists]['num_of_untranslated_strings'] += $resource_data['num_of_untranslated_strings']; + } + } } } - if ($add_last_coloumn) { - $lang_line[] = $resources;// last h coloumn + foreach ($language_summary as &$single_language_summary) { + $single_language_summary['num_of_translated_strings'] = + $single_language_summary['num_of_all_strings'] - + $single_language_summary['num_of_fuzzy_or_missing_strings'] - + $single_language_summary['num_of_untranslated_strings']; } - - $thfiles = '' . implode('', $lang_line) . '' . PHP_EOL; - if (!$restore_languages && !$restore_resources) { - $count = ' '; + unset($single_language_summary); // foreach by reference + foreach ($resource_summary as &$single_resource_summary) { + $single_resource_summary['num_of_translated_strings'] = + $single_resource_summary['num_of_all_strings'] - + $single_resource_summary['num_of_fuzzy_or_missing_strings'] - + $single_resource_summary['num_of_untranslated_strings']; } - if ($restore_languages) { - echo '

Restore all languages.

'; - $count = ' '; - } else { - $count = count($otherLangs) . ' languages'; + unset($single_resource_summary); // foreach by reference + + if ($one_language_all_resources) { + $report_text = '

Restore all languages.

'; + $count = 'One language: ' . $langs[$one_language]; + $summary_text = 'Summary for each of ' . $num_of_enFiles . ' resources'; + $display_array = $resource_summary; + $progress = 'ReferencesProgress'; + $stats_width = '55px'; + } else if ($all_languages_only_one_resource) { + $report_text = '

Restore all resources.

'; + $count = 'Together ' . count($otherLangs) . ' languages'; + $summary_text = 'Summary for resource: ' . $one_resource; + $eng_language = array_shift($language_summary); // shift English for proper sorting + $display_array = $language_summary; + $stats_width = '60px'; + $progress = 'ReferencesProgress'; + } else { // all languages, all resources + $report_text = ''; //

Overview of all languages.

+ $count = 'Together ' . count($otherLangs) . ' languages'; + $summary_text = 'Summary for all ' . $num_of_enFiles . ' resources'; + $eng_language = array_shift($language_summary); // shift English for proper sorting + $display_array = $language_summary; + $sum_for_stat = $total_num_of_strings; + $stats_width = '70px'; + $references = ''; + $progress = 'Progress'; } - if ($restore_resources) { - echo '

Restore all resources.

'; + + // build helper arrays + foreach ($display_array as $key => $row) { + if ($one_language_all_resources) { + $first_helper[$key] = $row['num_of_translated_strings'] / $row['num_of_all_strings']; + $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $row['num_of_all_strings']; + $third_helper[$key] = $row['resource_filename']; + } else if ($all_languages_only_one_resource) { + $first_helper[$key] = $row['num_of_translated_strings'] / $row['num_of_all_strings']; + $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $row['num_of_all_strings']; + $third_helper[$key] = $row['language']; + } else { // all languages, all resources + $first_helper[$key] = $row['num_of_translated_strings'] / $total_num_of_strings; + $second_helper[$key] = $row['num_of_fuzzy_or_missing_strings'] / $total_num_of_strings; + $third_helper[$key] = $row['language']; + } } - $chunks = array_chunk($languages, $num_lines_to_repeat = 8); // add header repeating - $table_body = array(); - $times[] = time_debug('table_body'); - foreach ($chunks as $chunk) { - $table_body = array_merge($table_body, $chunk, array(count($chunk) > ($num_lines_to_repeat / 2) ? '' . $count . '' . $resources . '' . $thfiles : '')); + array_multisort($first_helper, SORT_DESC, $second_helper, $third_helper, $display_array); // , SORT_STRING +// array_unshift($language_summary, $eng_language); // unshift English back + $table_lines = array(); + $progress_width = 350; + foreach ($display_array as $one_member) { + $translation_status = 'translated: ' . $one_member['num_of_translated_strings']; + $translation_status .= ', fuzzy or missing: ' . $one_member['num_of_fuzzy_or_missing_strings']; + if ($one_language_all_resources) { + $first_clmn = $one_member['resource_filename']; + $link_one = ''; + if ($first_clmn == '../_nav/langs/en.pot') { + $frst_clmn_t = '_nav/langs/en.pot'; + } else { + $frst_clmn_t = str_replace('en/', '', $first_clmn); + } + $first_clm_text = sprintf('' . $link_one . '%s', 'see this resource only', $frst_clmn_t); + $single_stat = $one_member['num_of_translated_strings']; + $sum_for_stat = $one_member['num_of_all_strings']; + $references = '' . $one_member['references'] . ''; + } else if ($all_languages_only_one_resource) { + $first_clmn = $one_member['language']; + $link_one = ''; + $first_clm_text = sprintf('' . $link_one . '%s, ', 'see this language only', $langs[$first_clmn]); + $single_stat = $one_member['num_of_translated_strings']; + $sum_for_stat = $one_member['num_of_all_strings']; + $references = '' . $one_member['references'] . ''; + } else { // all languages, all resources + $first_clmn = $one_member['language']; + $link_one = ''; + $first_clm_text = sprintf('' . $link_one . '%s, ', 'see this language only', $langs[$first_clmn]); + $first_clm_text .= sprintf('%s', $first_clmn); + $single_stat = $one_member['num_of_translated_strings']; + } + $progress_tran_float = $one_member['num_of_translated_strings'] / $sum_for_stat; + $progress_trans = floor($progress_tran_float * 100); + $progress_tran_round = floor($progress_tran_float * $progress_width); + $progress_fom_float = $one_member['num_of_fuzzy_or_missing_strings'] / $sum_for_stat; + $progress_fom_round = round($progress_fom_float * $progress_width); + $progress_untrans = $progress_width - $progress_tran_round - $progress_fom_round; + + + $row = '' . $first_clm_text . ''; + $row .= $references; + $row .= '
' . $progress_trans . ' %
'; + $row .= '
(' . $single_stat . ' / ' . $sum_for_stat . ')
'; + $row .= sprintf('' . $link_one, $translation_status); + $row .= '
 
' . PHP_EOL; + $row .= '
 
' . PHP_EOL; + $row .= '
 
' . PHP_EOL; + $row .= '' . PHP_EOL; + $table_lines[] = $row; } - array_unshift($table_body, $en_language); // unshift English back - $s = implode($table_body); + $table_rows = implode('', $table_lines); + echo $report_text; echo << + - - {$thfiles} + + -{$s} +{$table_rows}
{$count}Progress{$progress}{$summary_text}
@@ -365,11 +439,11 @@ foreach ($times as $time) { $snails[] = array($time[0], $time[1]); $sum += $time[1]; $pos = strpos($time[0], 'read_license_from_vcs'); - if ($pos !== false) { + if ($pos !== FALSE) { $read_license_from_vcs_[] = array($time[0], $time[1]); } $pos = strpos($time[0], '_diff'); - if ($pos !== false) { + if ($pos !== FALSE) { $_diff_[] = array($time[0], $time[1]); } } @@ -392,30 +466,49 @@ foreach ($_diff_ as $part) { } $snails_time += $_diff_time_sum = array_sum($_diff_time); -// read_license_from_vcs, mognas_f, _diff - -//print_r($read_license_from_vcs_) . '
' . PHP_EOL; -//print_r($mognas_f_) . '
' . PHP_EOL; -//print_r($_diff_) . '
' . PHP_EOL; -echo '
' . PHP_EOL;
-
-echo  '
' .'rlv: '; -print_r($read_license_from_vcs_time_sum) . '
' . PHP_EOL; -echo '
' .'dif: '; -print_r($_diff_time_sum) . '
' . PHP_EOL; -echo '
' .'Sst: '; -print_r($snails_time) . '
' . PHP_EOL; -echo '
' .'sum: '; -print_r($sum) . '
' . PHP_EOL; -echo '
' .'end: '; -print_r($end) . '
' . PHP_EOL; -echo '
' .'rel: ' . number_format(100 * $sum/$end, 1) . ' %
' . PHP_EOL; -/*echo '
' .'snails: ' . PHP_EOL; -print_r($snails) . PHP_EOL; -echo 'times: ' . PHP_EOL; -print_r($times) . PHP_EOL; /**/ -echo '
' . PHP_EOL; +if (FALSE) { + // read_license_from_vcs, mognas_f, _diff + + //var_export($read_license_from_vcs_) . '
' . PHP_EOL; + //var_export($_diff_) . '
' . PHP_EOL; + echo '
' . PHP_EOL;
+
+    echo  '
' .'$one_language_all_resources: '; + var_export($one_language_all_resources) . '
' . PHP_EOL; + + echo '
' .'$all_languages_only_one_resource: '; + var_export($all_languages_only_one_resource) . '
' . PHP_EOL; + + echo '
' .'$report: '; + var_export($report) . '
' . PHP_EOL; + + echo '
' .'$total_num_of_strings: '; + var_export($total_num_of_strings) . '
' . PHP_EOL; + + echo '
' .'$language_summary: '; + var_export($language_summary) . '
' . PHP_EOL; + + echo '
' .'$resource_summary: '; + var_export($resource_summary) . '
' . PHP_EOL; + + echo '
' .'rlv: '; + var_export($read_license_from_vcs_time_sum) . '
' . PHP_EOL; + echo '
' .'dif: '; + var_export($_diff_time_sum) . '
' . PHP_EOL; + echo '
' .'Sst: '; + var_export($snails_time) . '
' . PHP_EOL; + echo '
' .'sum: '; + var_export($sum) . '
' . PHP_EOL; + echo '
' .'end: '; + var_export($end) . '
' . PHP_EOL; + echo '
' .'rel: ' . number_format(100 * $sum/$end, 1) . ' %
' . PHP_EOL; + /*echo '
' .'snails: ' . PHP_EOL; + var_export($snails) . PHP_EOL; + echo 'times: ' . PHP_EOL; + var_export($times) . PHP_EOL; /**/ + echo '
' . PHP_EOL; /* END OF DEBUG LINES */ +} ?> -- cgit v1.2.1