[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Sat Jul 21 07:58:03 2007 UTC Modified files: /phpdoc/scripts revcheck.php Log: exclude new folder internals2 from revcheck http://cvs.php.net/viewvc.cgi/phpdoc/scripts/revcheck.php?r1=1.60r2=1.61diff_format=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.60 phpdoc/scripts/revcheck.php:1.61 --- phpdoc/scripts/revcheck.php:1.60Sat Aug 12 16:18:32 2006 +++ phpdoc/scripts/revcheck.php Sat Jul 21 07:58:02 2007 @@ -335,6 +335,7 @@ || $file == reserved.constants.xml || $file == 'DO_NOT_TRANSLATE' || strpos($dir, '/internals/') + || strpos($dir, '/internals2/') || ($file == functions.xml strpos($dir, '/reference/'))) continue;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
nlopess Sat Aug 12 16:18:33 2006 UTC Modified files: /phpdoc/scripts revcheck.php Log: don't translate the internals stuff http://cvs.php.net/viewvc.cgi/phpdoc/scripts/revcheck.php?r1=1.59r2=1.60diff_format=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.59 phpdoc/scripts/revcheck.php:1.60 --- phpdoc/scripts/revcheck.php:1.59Tue Jul 11 05:21:13 2006 +++ phpdoc/scripts/revcheck.php Sat Aug 12 16:18:32 2006 @@ -333,7 +333,8 @@ || $file == contributors.xml || $file == contributors.ent || $file == reserved.constants.xml - || $file == DO_NOT_TRANSLATE + || $file == 'DO_NOT_TRANSLATE' + || strpos($dir, '/internals/') || ($file == functions.xml strpos($dir, '/reference/'))) continue;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
takagi Tue Jul 11 05:21:13 2006 UTC Modified files: /phpdoc/scripts revcheck.php Log: 'install/windows/extensions.xml' should be checked. http://cvs.php.net/viewvc.cgi/phpdoc/scripts/revcheck.php?r1=1.58r2=1.59diff_format=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.58 phpdoc/scripts/revcheck.php:1.59 --- phpdoc/scripts/revcheck.php:1.58Wed Apr 19 20:17:46 2006 +++ phpdoc/scripts/revcheck.php Tue Jul 11 05:21:13 2006 @@ -328,7 +328,7 @@ if ( $file == rsusi.txt || $file == missing-ids.xml - || $file == extensions.xml + || ($file == extensions.xml strpos($dir, '/appendices/')) || $file == README || $file == contributors.xml || $file == contributors.ent
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Wed Apr 19 20:17:46 2006 UTC Modified files: /phpdoc/scripts revcheck.php Log: skip file created when we use livedocs (missing-ids.xml) http://cvs.php.net/viewcvs.cgi/phpdoc/scripts/revcheck.php?r1=1.57r2=1.58diff_format=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.57 phpdoc/scripts/revcheck.php:1.58 --- phpdoc/scripts/revcheck.php:1.57Fri Feb 10 10:26:14 2006 +++ phpdoc/scripts/revcheck.php Wed Apr 19 20:17:46 2006 @@ -327,6 +327,7 @@ // lang/reference/ tree, skip the file if ( $file == rsusi.txt + || $file == missing-ids.xml || $file == extensions.xml || $file == README || $file == contributors.xml
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
nlopess Fri Feb 10 10:26:14 2006 UTC Modified files: /phpdoc/scripts revcheck.php Log: fix bug reported by jsgroupil: the table header was repeated in some special cases (files tables) http://cvs.php.net/viewcvs.cgi/phpdoc/scripts/revcheck.php?r1=1.56r2=1.57diff_format=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.56 phpdoc/scripts/revcheck.php:1.57 --- phpdoc/scripts/revcheck.php:1.56Sun Feb 5 22:40:20 2006 +++ phpdoc/scripts/revcheck.php Fri Feb 10 10:26:14 2006 @@ -836,7 +836,7 @@ END_OF_MULTILINE; // This was the previous directory [first] -$prev_dir = $new_dir = $DOCDIR.en; +$prev_dir = false; // Go through all files collected foreach ($files_status as $num = $file) { @@ -864,14 +864,16 @@ $new_dir = dirname($file[full_name]); // If this is a new directory, put out old dir lines -if ($new_dir != $prev_dir isset($lines)) { -echo $prev_diplay_dir; -echo ($line_number)/th/tr; - echo $lines; - - $lines = ''; - $line_number = 0; - +if ($new_dir !== $prev_dir) { +if (isset($lines)) { +echo $prev_diplay_dir; +echo ($line_number)/th/tr; +echo $lines; +} + +$lines = ''; +$line_number = 0; + // Store the new actual directory $prev_dir = $new_dir; }
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
nlopess Sun Feb 5 22:40:20 2006 UTC Modified files: /phpdoc/scripts revcheck.php Log: update links to on-line CVS diffs http://cvs.php.net/viewcvs.cgi/phpdoc/scripts/revcheck.php?r1=1.55r2=1.56diff_format=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.55 phpdoc/scripts/revcheck.php:1.56 --- phpdoc/scripts/revcheck.php:1.55Fri Dec 16 23:24:19 2005 +++ phpdoc/scripts/revcheck.php Sun Feb 5 22:40:20 2006 @@ -83,7 +83,7 @@ // Option for the link to cvs.php.net: define('CVS_OPT', 'amp;view=patch'); -define('CVS_OPT_NOWS', 'amp;view=diffamp;diff_format=h'); +define('CVS_OPT_NOWS', ''); // Initializing variables from parameters $LANG = $argv[1]; @@ -852,8 +852,7 @@ if ($file[revision][2] != n/a $file[revision][2] !== 0) { $url = 'http://cvs.php.net/viewcvs.cgi/' . preg_replace( '^.$DOCDIR.', 'phpdoc/', $file['full_name']) . - '?tr1=' . $file['revision'][1] . 'amp;tr2=' . $file['revision'][0] . - 'amp;r1=textamp;r2=text'; + '?r1=' . $file['revision'][1] . 'amp;r2=' . $file['revision'][0]; $url_ws = $url . CVS_OPT_NOWS; $url .= CVS_OPT;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
nlopess Fri Dec 16 23:24:19 2005 EDT Modified files: /phpdoc/scripts revcheck.php Log: update URLs to match the change of the software in the cvs machine http://cvs.php.net/viewcvs.cgi/phpdoc/scripts/revcheck.php?r1=1.54r2=1.55diff_format=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.54 phpdoc/scripts/revcheck.php:1.55 --- phpdoc/scripts/revcheck.php:1.54Mon Sep 19 19:35:35 2005 +++ phpdoc/scripts/revcheck.php Fri Dec 16 23:24:19 2005 @@ -81,9 +81,9 @@ REV_WIP = wip, ); -// Option for the link to cvs.php.net: normal: f=h -// long diff: f=hnum=10, unified (text): f=u -define(CVS_OPT, amp;ty=u); +// Option for the link to cvs.php.net: +define('CVS_OPT', 'amp;view=patch'); +define('CVS_OPT_NOWS', 'amp;view=diffamp;diff_format=h'); // Initializing variables from parameters $LANG = $argv[1]; @@ -837,33 +837,33 @@ // This was the previous directory [first] $prev_dir = $new_dir = $DOCDIR.en; - + // Go through all files collected foreach ($files_status as $num = $file) { - + // Make the maintainer a link, if we have that maintainer in the list if (isset($maint_by_nick[$file[maintainer]])) { $file[maintainer] = 'a href=#maint' . $maint_by_nick[$file[maintainer]] . '' . $file[maintainer] . '/a'; } - + // If we have a 'numeric' revision diff and it is not zero, // make a link to the CVS repository's diff script if ($file[revision][2] != n/a $file[revision][2] !== 0) { -$url = 'http://cvs.php.net/diff.php/' . +$url = 'http://cvs.php.net/viewcvs.cgi/' . preg_replace( '^.$DOCDIR.', 'phpdoc/', $file['full_name']) . - '?r1=' . $file['revision'][1] . - 'amp;r2=' . $file['revision'][0] . - CVS_OPT; -$url_ws = $url . 'amp;ws=0'; + '?tr1=' . $file['revision'][1] . 'amp;tr2=' . $file['revision'][0] . + 'amp;r1=textamp;r2=text'; +$url_ws = $url . CVS_OPT_NOWS; +$url .= CVS_OPT; $file['short_name'] = 'a href=' . $url . ''. $file[short_name] . '/a '. 'a href=' . $url_ws . '[NoWS]/a'; } - + // Guess the new directory from the full name of the file $new_dir = dirname($file[full_name]); - + // If this is a new directory, put out old dir lines if ($new_dir != $prev_dir isset($lines)) { echo $prev_diplay_dir; @@ -1034,7 +1034,7 @@ $prev_dir = $new_dir; } -print tr class=wiptda href=\http://cvs.php.net/co.php/phpdoc/en/$file\;$short_file/a/td . +print tr class=wiptda href=\http://cvs.php.net/viewcvs.cgi/phpdoc/en/$file?view=markup\;$short_file/a/td . td class=r$info[0]/td/tr\n; } print /table\npnbsp;/p\n$navbarpnbsp;/p\n;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Mon Sep 19 15:35:38 2005 EDT Modified files: /phpdoc/scripts revcheck.php Log: correct 2 html's errors http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.53r2=1.54ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.53 phpdoc/scripts/revcheck.php:1.54 --- phpdoc/scripts/revcheck.php:1.53Mon Aug 29 18:11:33 2005 +++ phpdoc/scripts/revcheck.php Mon Sep 19 15:35:35 2005 @@ -661,7 +661,7 @@ if (!empty($translation[intro])) { print 'a name=intro/a'; print 'table width=800 align=centertrtd class=c' . - $translation['intro'] . '/td/tr/tablep/p'; + $translation['intro'] . '/td/tr/table'; } // = @@ -1046,7 +1046,7 @@ if ($count 0) { print a name=\oldfiles\/a . table width=\400\ border=\0\ cellpadding=\3\ cellspacing=\1\ align=\center\\n . - tr class=bluetha name=\avail\ class=\ref\ . + tr class=bluetha name=\notEn\ class=\ref\ . Not in EN Tree/a ($count files):/ththkB/th/tr\n; foreach($old_files as $file = $info) {
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Mon Aug 29 18:11:35 2005 EDT Modified files: /phpdoc/scripts revcheck.php Log: add extensions.xml to ignore list http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.52r2=1.53ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.52 phpdoc/scripts/revcheck.php:1.53 --- phpdoc/scripts/revcheck.php:1.52Tue Jul 12 15:51:32 2005 +++ phpdoc/scripts/revcheck.php Mon Aug 29 18:11:33 2005 @@ -327,6 +327,7 @@ // lang/reference/ tree, skip the file if ( $file == rsusi.txt + || $file == extensions.xml || $file == README || $file == contributors.xml || $file == contributors.ent
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Sat Jul 2 15:04:49 2005 EDT Modified files: /phpdoc/scripts revcheck.php Log: Add info for old files http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.48r2=1.49ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.48 phpdoc/scripts/revcheck.php:1.49 --- phpdoc/scripts/revcheck.php:1.48Fri Oct 29 10:20:44 2004 +++ phpdoc/scripts/revcheck.php Sat Jul 2 15:04:47 2005 @@ -373,6 +373,85 @@ } // get_dir_status() function end + +// Check for files removed in the EN tree, but still living in the translation +function get_old_files($dir) +{ + +global $DOCDIR, $LANG; + +// Collect files and diretcories in these arrays +$directories = array(); +$files = array(); + +$special_files = array( + // french + 'LISEZ_MOI.txt', + 'TRADUCTIONS.txt', + 'Translators', + 'translation.xml' + + // todo: add all missing languages +); + +// Open the directory +$handle = @opendir($dir); + +// Walk through all names in the directory +while ($file = @readdir($handle)) { + + // If we found a file with one or two point as a name, + // or a CVS directory, skip the file + if (preg_match(/^\.{1,2}/, $file) || $file == 'CVS') +continue; + + // skip this files + if (in_array($file, $special_files)) { +continue; + } + + // Collect files and directories + if (is_dir($dir.$file)) { +$directories[] = $file; + } else { +$files[] = $file; + } + +} + +// Close the directory +@closedir($handle); + +// Sort files and directories +sort($directories); +sort($files); + +// Go through files first +$old_files_status = array(); +foreach ($files as $file) { + + $en_dir = preg_replace('^.$DOCDIR.$LANG./', $DOCDIR.en/, $dir); + + if ([EMAIL PROTECTED]($en_dir.$file) ) { +$old_files_status[$dir.$file] = array(0=intval(filesize($dir.$file)/1024)); + } + +} + +// Then go through subdirectories, merging all the info +// coming from subdirs to one array +foreach ($directories as $file) { +$old_files_status = array_merge( +$old_files_status, +get_old_files($dir.$file.'/') +); +} + +return $old_files_status; + +} // get_old_files() function end + + // = // Functions to read in the translation.xml file and process contents // = @@ -515,6 +594,8 @@ // Get all files status $files_status = get_dir_status($DOCDIR.en/); +// Get all old files in lang directory +$old_files = get_old_files($DOCDIR.$LANG./); $navbar = p class=ca href=\#intro\Introduction/a | . a href=\#translators\Translators/a | . @@ -523,7 +604,8 @@ if (count($translation[files]) != 0) $navbar .= a href=\#wip\Work in progress/a | ; $navbar .= a href=\#misstags\Missing revision numbers/a | . - a href=\#missfiles\Untranslated files/a/p\n; + a href=\#missfiles\Untranslated files/a | . + a href=\#oldfiles\Old files/a/p\n; // Figure out generation date @@ -955,6 +1037,42 @@ } +// Files not in EN tree +$count = count($old_files); +if ($count 0) { +print a name=\oldfiles\/a . + table width=\400\ border=\0\ cellpadding=\3\ cellspacing=\1\ align=\center\\n . + tr class=bluetha name=\avail\ class=\ref\ . + Not in EN Tree/a ($count files):/ththkB/th/tr\n; + +foreach($old_files as $file = $info) { +// Shorten the filename (we have directory headers) +$short_file = basename($file); + +// Guess the new directory from the full name of the file +$new_dir = dirname($file); + +// If this is a new directory, put out dir headline +if ($new_dir != $prev_dir) { + +// Print out directory header if not . +print tr class=blueth colspan=2$new_dir/th/tr\n; + +// Store the new actual directory +$prev_dir = $new_dir; +} + +print tr class=wiptda href=\http://cvs.php.net/co.php/phpdoc/en/$file\;$short_file/a/td . + td class=r$info[0]/td/tr\n; +} +print /table\npnbsp;/p\n$navbarpnbsp;/p\n; + + + + +} + + // All OK, end the file print /body\n/html\n;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Sat Jul 2 15:11:59 2005 EDT Modified files: /phpdoc/scripts revcheck.php Log: Remove links for old files http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.49r2=1.50ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.49 phpdoc/scripts/revcheck.php:1.50 --- phpdoc/scripts/revcheck.php:1.49Sat Jul 2 15:04:47 2005 +++ phpdoc/scripts/revcheck.php Sat Jul 2 15:11:58 2005 @@ -1062,7 +1062,7 @@ $prev_dir = $new_dir; } -print tr class=wiptda href=\http://cvs.php.net/co.php/phpdoc/en/$file\;$short_file/a/td . +print tr class=wiptd$short_file/td . td class=r$info[0]/td/tr\n; } print /table\npnbsp;/p\n$navbarpnbsp;/p\n;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Fri Oct 29 10:20:44 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: Index: scripts/revcheck.php http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.47r2=1.48ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.47 phpdoc/scripts/revcheck.php:1.48 --- phpdoc/scripts/revcheck.php:1.47Sun Sep 5 18:11:53 2004 +++ phpdoc/scripts/revcheck.php Fri Oct 29 10:20:44 2004 @@ -727,6 +727,8 @@ // Files table goes here // = +if (count($files_status) != 0) { + print END_OF_MULTILINE a name=files/a table width=820 border=0 cellpadding=4 cellspacing=1 align=center @@ -751,70 +753,72 @@ /tr END_OF_MULTILINE; -// This was the previous directory [first] -$prev_dir = $new_dir = $DOCDIR.en; - -// Go through all files collected -foreach ($files_status as $num = $file) { - -// Make the maintainer a link, if we have that maintainer in the list -if (isset($maint_by_nick[$file[maintainer]])) { - $file[maintainer] = 'a href=#maint' . $maint_by_nick[$file[maintainer]] . -'' . $file[maintainer] . '/a'; -} - -// If we have a 'numeric' revision diff and it is not zero, -// make a link to the CVS repository's diff script -if ($file[revision][2] != n/a $file[revision][2] !== 0) { -$file[short_name] = a href=\http://cvs.php.net/diff.php/; . - preg_replace( '^.$DOCDIR.', phpdoc/, $file[full_name]) . - ?r1= . $file[revision][1] . - amp;r2= . $file[revision][0] . - CVS_OPT . \ . $file[short_name] . /a; -} - -// Guess the new directory from the full name of the file -$new_dir = dirname($file[full_name]); - -// If this is a new directory, put out old dir lines -if ($new_dir != $prev_dir isset($lines)) { -echo $prev_diplay_dir; -echo ($line_number)/th/tr; - echo $lines; - - $lines = ''; - $line_number = 0; - -// Store the new actual directory -$prev_dir = $new_dir; -} -// Drop out the unneeded parts from the dirname... -$display_dir = str_replace($DOCDIR.en/, , dirname($file[full_name])); -$prev_diplay_dir = tr class=blueth colspan=12$display_dir; - -// Save the line for the current file (get file name shorter) -$lines .= tr class={$CSS[$file['mark']]}td{$file['short_name']}/td. - td {$file['revision'][0]}/td . - td {$file['revision'][1]}/td. - td class=rb{$file['revision'][2]} /td. - td class=r{$file['size'][0]} /td. - td class=r{$file['size'][1]} /td. - td class=rb{$file['size'][2]} /td. - td class=r{$file['date'][0]} /td. - td class=r{$file['date'][1]} /td. - td class=rb{$file['date'][2]} /td. - td class=c{$file['maintainer']}/td. - td class=c.trim($file['status'])./td/tr\n; - $line_number++; - +// This was the previous directory [first] +$prev_dir = $new_dir = $DOCDIR.en; + +// Go through all files collected +foreach ($files_status as $num = $file) { + +// Make the maintainer a link, if we have that maintainer in the list +if (isset($maint_by_nick[$file[maintainer]])) { + $file[maintainer] = 'a href=#maint' . $maint_by_nick[$file[maintainer]] . +'' . $file[maintainer] . '/a'; +} + +// If we have a 'numeric' revision diff and it is not zero, +// make a link to the CVS repository's diff script +if ($file[revision][2] != n/a $file[revision][2] !== 0) { +$file[short_name] = a href=\http://cvs.php.net/diff.php/; . + preg_replace( '^.$DOCDIR.', phpdoc/, $file[full_name]) . + ?r1= . $file[revision][1] . + amp;r2= . $file[revision][0] . + CVS_OPT . \ . $file[short_name] . /a; +} + +// Guess the new directory from the full name of the file +$new_dir = dirname($file[full_name]); + +// If this is a new directory, put out old dir lines +if ($new_dir != $prev_dir isset($lines)) { +echo $prev_diplay_dir; +echo ($line_number)/th/tr; + echo $lines; + + $lines = ''; + $line_number = 0; + +// Store the new actual directory +$prev_dir = $new_dir; +} +// Drop out the unneeded parts from the dirname... +$display_dir = str_replace($DOCDIR.en/, , dirname($file[full_name])); +$prev_diplay_dir = tr class=blueth colspan=12$display_dir; + +// Save the line for the current file (get file name shorter) +$lines .= tr
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Sun Sep 5 16:27:04 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: escape new reserved.constants.xml file http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.45r2=1.46ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.45 phpdoc/scripts/revcheck.php:1.46 --- phpdoc/scripts/revcheck.php:1.45Wed Aug 4 07:27:39 2004 +++ phpdoc/scripts/revcheck.php Sun Sep 5 16:27:04 2004 @@ -36,14 +36,14 @@ the files maintained by the person you add here If you specify revcheck.html, the output is an html file. - + Read more about Revision comments and related functionality in the PHP Documentation Howto: http://php.net/manual/howto/translation-revtrack.html - + Authors: Thomas Schöfbeck [EMAIL PROTECTED] Gabor Hojtsy [EMAIL PROTECTED] - Mark Kronsbein [EMAIL PROTECTED] + Mark Kronsbein [EMAIL PROTECTED] Jan Fabry [EMAIL PROTECTED] ?php @@ -96,12 +96,12 @@ // Main directory of the PHP documentation (depends on the // sapi used). We do need the trailing slash! if (cli === php_sapi_name()) { - if (isset($PHPDOCDIR) is_dir($PHPDOCDIR)) - $DOCDIR = $PHPDOCDIR./; - else - $DOCDIR = ./; + if (isset($PHPDOCDIR) is_dir($PHPDOCDIR)) + $DOCDIR = $PHPDOCDIR./; + else + $DOCDIR = ./; } else - $DOCDIR = ../; + $DOCDIR = ../; // = // Functions to get revision info and credits from a file @@ -125,30 +125,30 @@ // Handle credits (only if no maintainer is specified) if ($val == \\S*) { - + global $files_by_maint; // Find credits info, let more credits then one, // using commas as list separator if (preg_match('!--\s*CREDITS:\s*(.+)\s*--'U, $line, $match_credit)) { - + // Explode with commas a separators $credits = explode(,, $match_credit[1]); - + // Store all elements foreach ($credits as $num = $credit) { $files_by_maint[trim($credit)][REV_CREDIT]++; } - + } } // No match before the preg $match = array(); - + // Check for the translations revision tag preg_match (/!--\s*EN-Revision:\s*\d+\.(\d+)\s*Maintainer:\s*( -. $val . )\s*Status:\s*(.+)\s*--/U, +. $val . )\s*Status:\s*(.+)\s*--/U, $line, $match ); @@ -165,7 +165,7 @@ // Return with found revision info (number, maint, status) return $match; - + } // get_tags() function end @@ -193,7 +193,7 @@ $file_sizes_by_mark[REV_NOTRANS] += $size; // compute en-tags just if they're needed in the WIP-Table if($using_rev) { - $missing_files[$trans_name][] = 1..get_tags($file); + $missing_files[$trans_name][] = 1..get_tags($file); } return FALSE; } @@ -223,7 +223,7 @@ $en_size= intval(filesize($file) / 1024); $trans_size = intval(filesize($trans_file) / 1024); $size_diff = intval($en_size) - intval($trans_size); - + // If we found no revision tag, then collect this // file in the missing tags list if (count($trans_tag) == 0) { @@ -238,7 +238,7 @@ // Get English file revision $en_rev = get_tags($file); - + // If we have a numeric revision number (not n/a), compute rev. diff if (is_numeric($this_rev)) { $rev_diff = intval($en_rev) - intval($this_rev); @@ -257,9 +257,9 @@ $files_by_mark[REV_UPTODATE]++; $files_by_maint[$this_maint][REV_UPTODATE]++; $file_sizes_by_mark[REV_UPTODATE] += $en_size; - + return FALSE; -} +} // Compute times and diffs $en_date= intval((time() - filemtime($file)) / 86400); @@ -290,7 +290,7 @@ status = $this_status, mark = $status_mark ); - + } // get_file_status() function end // = @@ -306,14 +306,14 @@ if (preg_match(!/en/functions|/chmonly!, $dir)) { return array(); } - + // Collect files and diretcories in these arrays $directories = array(); $files = array(); - -// Open the directory + +// Open the directory $handle = @opendir($dir); - + // Walk through all names in the directory while ($file = @readdir($handle)) { @@ -327,12 +327,13 @@ // lang/reference/ tree, skip the file if ( $file == make_chm_index_en.html - || $file == rsusi.txt - || $file == README - || $file == contributors.xml - || $file == contributors.ent - || $file == DO_NOT_TRANSLATE - || ($file == functions.xml strpos($dir, '/reference/'))) +
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
Please check your diffs before commit, this diff is impossible to understand. Regards, Philip On Sun, 5 Sep 2004, Yannick TORRES wrote: yannick Sun Sep 5 16:27:04 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: escape new reserved.constants.xml file
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
On Sunday 05 September 2004 22:35, Philip Olson wrote: Please check your diffs before commit, this diff is impossible to understand. Oops, sorry. My editor transforms the tabulations into space... I have just add new file to escape. Would you like me to revert this commit and commit just this change ? Regards, Philip On Sun, 5 Sep 2004, Yannick TORRES wrote: yannick Sun Sep 5 16:27:04 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: escape new reserved.constants.xml file Regards, -- Yannick
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
Yannick Torres wrote: On Sunday 05 September 2004 22:35, Philip Olson wrote: Please check your diffs before commit, this diff is impossible to understand. Oops, sorry. My editor transforms the tabulations into space... I have just add new file to escape. Would you like me to revert this commit and commit just this change ? While tabs are evil, it seems your editor has, in the process, made some poor choices on how to convert from tabs to spaces, I think you should revert. -- Tom
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Sun Sep 5 18:11:55 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: revert to tabulations instead of spaces http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.46r2=1.47ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.46 phpdoc/scripts/revcheck.php:1.47 --- phpdoc/scripts/revcheck.php:1.46Sun Sep 5 16:27:04 2004 +++ phpdoc/scripts/revcheck.php Sun Sep 5 18:11:53 2004 @@ -36,14 +36,14 @@ the files maintained by the person you add here If you specify revcheck.html, the output is an html file. - + Read more about Revision comments and related functionality in the PHP Documentation Howto: http://php.net/manual/howto/translation-revtrack.html - + Authors: Thomas Schöfbeck [EMAIL PROTECTED] Gabor Hojtsy [EMAIL PROTECTED] - Mark Kronsbein [EMAIL PROTECTED] + Mark Kronsbein [EMAIL PROTECTED] Jan Fabry [EMAIL PROTECTED] ?php @@ -96,12 +96,12 @@ // Main directory of the PHP documentation (depends on the // sapi used). We do need the trailing slash! if (cli === php_sapi_name()) { - if (isset($PHPDOCDIR) is_dir($PHPDOCDIR)) - $DOCDIR = $PHPDOCDIR./; - else - $DOCDIR = ./; + if (isset($PHPDOCDIR) is_dir($PHPDOCDIR)) + $DOCDIR = $PHPDOCDIR./; + else + $DOCDIR = ./; } else - $DOCDIR = ../; + $DOCDIR = ../; // = // Functions to get revision info and credits from a file @@ -125,30 +125,30 @@ // Handle credits (only if no maintainer is specified) if ($val == \\S*) { - + global $files_by_maint; // Find credits info, let more credits then one, // using commas as list separator if (preg_match('!--\s*CREDITS:\s*(.+)\s*--'U, $line, $match_credit)) { - + // Explode with commas a separators $credits = explode(,, $match_credit[1]); - + // Store all elements foreach ($credits as $num = $credit) { $files_by_maint[trim($credit)][REV_CREDIT]++; } - + } } // No match before the preg $match = array(); - + // Check for the translations revision tag preg_match (/!--\s*EN-Revision:\s*\d+\.(\d+)\s*Maintainer:\s*( -. $val . )\s*Status:\s*(.+)\s*--/U, +. $val . )\s*Status:\s*(.+)\s*--/U, $line, $match ); @@ -165,7 +165,7 @@ // Return with found revision info (number, maint, status) return $match; - + } // get_tags() function end @@ -193,7 +193,7 @@ $file_sizes_by_mark[REV_NOTRANS] += $size; // compute en-tags just if they're needed in the WIP-Table if($using_rev) { - $missing_files[$trans_name][] = 1..get_tags($file); + $missing_files[$trans_name][] = 1..get_tags($file); } return FALSE; } @@ -223,7 +223,7 @@ $en_size= intval(filesize($file) / 1024); $trans_size = intval(filesize($trans_file) / 1024); $size_diff = intval($en_size) - intval($trans_size); - + // If we found no revision tag, then collect this // file in the missing tags list if (count($trans_tag) == 0) { @@ -238,7 +238,7 @@ // Get English file revision $en_rev = get_tags($file); - + // If we have a numeric revision number (not n/a), compute rev. diff if (is_numeric($this_rev)) { $rev_diff = intval($en_rev) - intval($this_rev); @@ -257,9 +257,9 @@ $files_by_mark[REV_UPTODATE]++; $files_by_maint[$this_maint][REV_UPTODATE]++; $file_sizes_by_mark[REV_UPTODATE] += $en_size; - + return FALSE; -} +} // Compute times and diffs $en_date= intval((time() - filemtime($file)) / 86400); @@ -290,7 +290,7 @@ status = $this_status, mark = $status_mark ); - + } // get_file_status() function end // = @@ -306,14 +306,14 @@ if (preg_match(!/en/functions|/chmonly!, $dir)) { return array(); } - + // Collect files and diretcories in these arrays $directories = array(); $files = array(); - -// Open the directory + +// Open the directory $handle = @opendir($dir); - + // Walk through all names in the directory while ($file = @readdir($handle)) { @@ -327,13 +327,13 @@ // lang/reference/ tree, skip the file if ( $file == make_chm_index_en.html - || $file == rsusi.txt - || $file == README - || $file == contributors.xml - || $file == contributors.ent - || $file == reserved.constants.xml - || $file == DO_NOT_TRANSLATE - || ($file == functions.xml strpos($dir, '/reference/')))
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
yannick Wed Aug 4 07:27:39 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: escape new contributors.ent file http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.44r2=1.45ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.44 phpdoc/scripts/revcheck.php:1.45 --- phpdoc/scripts/revcheck.php:1.44Wed Jul 21 09:59:03 2004 +++ phpdoc/scripts/revcheck.php Wed Aug 4 07:27:39 2004 @@ -330,6 +330,7 @@ || $file == rsusi.txt || $file == README || $file == contributors.xml + || $file == contributors.ent || $file == DO_NOT_TRANSLATE || ($file == functions.xml strpos($dir, '/reference/'))) continue;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Wed Jul 21 09:59:04 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: ignore this new file too # spotted by yannick http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.43r2=1.44ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.43 phpdoc/scripts/revcheck.php:1.44 --- phpdoc/scripts/revcheck.php:1.43Sun Jun 6 13:17:48 2004 +++ phpdoc/scripts/revcheck.php Wed Jul 21 09:59:03 2004 @@ -329,6 +329,7 @@ $file == make_chm_index_en.html || $file == rsusi.txt || $file == README + || $file == contributors.xml || $file == DO_NOT_TRANSLATE || ($file == functions.xml strpos($dir, '/reference/'))) continue;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Sun Jun 6 13:17:48 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: ignore the new README file and stick to the same size format http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.42r2=1.43ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.42 phpdoc/scripts/revcheck.php:1.43 --- phpdoc/scripts/revcheck.php:1.42Wed May 26 15:40:27 2004 +++ phpdoc/scripts/revcheck.php Sun Jun 6 13:17:48 2004 @@ -188,7 +188,7 @@ if ([EMAIL PROTECTED]($trans_file)) { $files_by_mark[REV_NOTRANS]++; $trans_name = substr($trans_file, strlen($DOCDIR) + strlen($LANG) + 1); -$size = round(filesize($file)/1024, 1); +$size = intval(filesize($file)/1024); $missing_files[$trans_name] = array( $size ); $file_sizes_by_mark[REV_NOTRANS] += $size; // compute en-tags just if they're needed in the WIP-Table @@ -328,6 +328,7 @@ if ( $file == make_chm_index_en.html || $file == rsusi.txt + || $file == README || $file == DO_NOT_TRANSLATE || ($file == functions.xml strpos($dir, '/reference/'))) continue;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Wed May 26 15:40:27 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: added a link to the revision tracking page and used ?php http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.41r2=1.42ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.41 phpdoc/scripts/revcheck.php:1.42 --- phpdoc/scripts/revcheck.php:1.41Sun May 23 05:52:25 2004 +++ phpdoc/scripts/revcheck.php Wed May 26 15:40:27 2004 @@ -27,7 +27,7 @@ the actual english xml files, and print statistics Usage: - ?=$argv[0]? language-code [maintainer] [revcheck.html] + ?php echo $argv[0]; ? language-code [maintainer] [revcheck.html] language-code must be a valid language code used in the repository @@ -38,7 +38,8 @@ If you specify revcheck.html, the output is an html file. Read more about Revision comments and related - functionality in the PHP Documentation Howto. + functionality in the PHP Documentation Howto: +http://php.net/manual/howto/translation-revtrack.html Authors: Thomas Schöfbeck [EMAIL PROTECTED] Gabor Hojtsy [EMAIL PROTECTED]
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
nlopess Sun May 23 05:52:25 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: fix bug in revcheck http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.40r2=1.41ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.40 phpdoc/scripts/revcheck.php:1.41 --- phpdoc/scripts/revcheck.php:1.40Sat May 22 16:52:03 2004 +++ phpdoc/scripts/revcheck.php Sun May 23 05:52:25 2004 @@ -772,7 +772,7 @@ $new_dir = dirname($file[full_name]); // If this is a new directory, put out old dir lines -if ($new_dir != $prev_dir) { +if ($new_dir != $prev_dir isset($lines)) { echo $prev_diplay_dir; echo ($line_number)/th/tr; echo $lines;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Sat May 22 16:52:03 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: fixed the cvs diff link and a bug with the first line of Files http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.39r2=1.40ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.39 phpdoc/scripts/revcheck.php:1.40 --- phpdoc/scripts/revcheck.php:1.39Sat May 22 00:03:45 2004 +++ phpdoc/scripts/revcheck.php Sat May 22 16:52:03 2004 @@ -82,7 +82,7 @@ // Option for the link to cvs.php.net: normal: f=h // long diff: f=hnum=10, unified (text): f=u -define(CVS_OPT, amp;f=u); +define(CVS_OPT, amp;ty=u); // Initializing variables from parameters $LANG = $argv[1]; @@ -772,7 +772,7 @@ $new_dir = dirname($file[full_name]); // If this is a new directory, put out old dir lines -if ($new_dir != $prev_dir isset($lines)) { +if ($new_dir != $prev_dir) { echo $prev_diplay_dir; echo ($line_number)/th/tr; echo $lines;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Fri May 21 18:50:00 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: fixed a typo added some skip files and dirs changed a regexp to a simple strpos and fixed a bug (reference/ingres-ii/functions.xml was shown as available for translation) added the display of file total when showing the Files area http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.37r2=1.38ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.37 phpdoc/scripts/revcheck.php:1.38 --- phpdoc/scripts/revcheck.php:1.37Tue Feb 24 15:57:17 2004 +++ phpdoc/scripts/revcheck.php Fri May 21 18:50:00 2004 @@ -38,7 +38,7 @@ If you specify revcheck.html, the output is an html file. Read more about Revision comments and related - funcionality in the PHP Documentation Howto. + functionality in the PHP Documentation Howto. Authors: Thomas Schöfbeck [EMAIL PROTECTED] Gabor Hojtsy [EMAIL PROTECTED] @@ -302,7 +302,7 @@ { // If this is an old functions directory // (not under reference) then do not travers -if (preg_match(!/en/functions!, $dir)) { +if (preg_match(!/en/functions|/chmonly!, $dir)) { return array(); } @@ -324,7 +324,11 @@ // JUST TEMPORARY TILL THE TRANSLATION/REFERENCE/FUNCTIONS.XML - ISSUE IS CLARIFIED // If we found a file functions.xml in the // lang/reference/ tree, skip the file - if ($file == functions.xml preg_match(!/\w+/reference/\w+/!, $dir)) + if ( + $file == make_chm_index_en.html + || $file == rsusi.txt + || $file == DO_NOT_TRANSLATE + || ($file == functions.xml strpos($dir, '/reference/'))) continue; // Collect files and directories @@ -483,18 +487,6 @@ } // parse_translation() function end() // = -// Debug functions for all the functions and code on this page -// = - -// Print preformatted (debug function) -function print_pre($var) -{ -print(pre); -print_r($var); -print(/pre); -} // print_pre() function end - -// = // Start of the program execution // = @@ -779,21 +771,24 @@ // Guess the new directory from the full name of the file $new_dir = dirname($file[full_name]); -// If this is a new directory, put out dir headline -if ($new_dir != $prev_dir) { - -// Drop out the unneeded parts from the dirname... -$display_dir = str_replace($DOCDIR.en/, , dirname($file[full_name])); - -// Print out directory header -print tr class=blueth colspan=12$display_dir/th/tr\n; +// If this is a new directory, put out old dir lines +if ($new_dir != $prev_dir isset($lines)) { +echo $prev_diplay_dir; +echo ($line_number)/th/tr; + echo $lines; + + $lines = ''; + $line_number = 0; // Store the new actual directory $prev_dir = $new_dir; } +// Drop out the unneeded parts from the dirname... +$display_dir = str_replace($DOCDIR.en/, , dirname($file[full_name])); +$prev_diplay_dir = tr class=blueth colspan=12$display_dir; -// Write out the line for the current file (get file name shorter) -print tr class={$CSS[$file['mark']]}td{$file['short_name']}/td. +// Save the line for the current file (get file name shorter) +$lines .= tr class={$CSS[$file['mark']]}td{$file['short_name']}/td. td {$file['revision'][0]}/td . td {$file['revision'][1]}/td. td class=rb{$file['revision'][2]} /td. @@ -805,9 +800,14 @@ td class=rb{$file['date'][2]} /td. td class=c{$file['maintainer']}/td. td class=c.trim($file['status'])./td/tr\n; + $line_number++; } +// echo the last dir and $lines +echo $prev_diplay_dir ($line_number)/th/tr; +echo $lines; + print(/table\npnbsp;/p\n$navbarpnbsp;/p\n);
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Sat May 22 00:03:45 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: link to unified diffs since we're more used to see them (this commit mail for example) http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.38r2=1.39ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.38 phpdoc/scripts/revcheck.php:1.39 --- phpdoc/scripts/revcheck.php:1.38Fri May 21 18:50:00 2004 +++ phpdoc/scripts/revcheck.php Sat May 22 00:03:45 2004 @@ -82,7 +82,7 @@ // Option for the link to cvs.php.net: normal: f=h // long diff: f=hnum=10, unified (text): f=u -define(CVS_OPT, amp;f=hamp;num=10); +define(CVS_OPT, amp;f=u); // Initializing variables from parameters $LANG = $argv[1];
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
didou Tue Feb 24 15:57:17 2004 EDT Modified files: /phpdoc/scripts revcheck.php Log: typo and added pear's revcheck hint http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.36r2=1.37ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.36 phpdoc/scripts/revcheck.php:1.37 --- phpdoc/scripts/revcheck.php:1.36Wed Dec 31 19:47:42 2003 +++ phpdoc/scripts/revcheck.php Tue Feb 24 15:57:17 2004 @@ -27,13 +27,15 @@ the actual english xml files, and print statistics Usage: - ?=$argv[0]? language-code [maintainer] + ?=$argv[0]? language-code [maintainer] [revcheck.html] language-code must be a valid language code used in the repository If you specify maintainer, the script only checks - the files maintaned by the person you add here + the files maintained by the person you add here + + If you specify revcheck.html, the output is an html file. Read more about Revision comments and related funcionality in the PHP Documentation Howto.
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
cheezy Wed Jul 23 18:29:04 2003 EDT Modified files: /phpdoc/scripts revcheck.php Log: Show file sizes in summary, link to English version in CVS for untranslated files Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.34 phpdoc/scripts/revcheck.php:1.35 --- phpdoc/scripts/revcheck.php:1.34Sun Dec 22 04:45:57 2002 +++ phpdoc/scripts/revcheck.php Wed Jul 23 18:29:04 2003 @@ -17,6 +17,7 @@ # | Authors:Thomas Schöfbeck [EMAIL PROTECTED] | # | Gabor Hojtsy [EMAIL PROTECTED] | # | Mark Kronsbein [EMAIL PROTECTED] | +# | Jan Fabry [EMAIL PROTECTED] # +--+ */ if ($argc 2 || $argc 3) { @@ -40,6 +41,7 @@ Authors: Thomas Schöfbeck [EMAIL PROTECTED] Gabor Hojtsy [EMAIL PROTECTED] Mark Kronsbein [EMAIL PROTECTED] + Jan Fabry [EMAIL PROTECTED] ?php exit; @@ -173,6 +175,7 @@ { // The information is contained in these global arrays and vars global $DOCDIR, $LANG, $MAINT, $files_by_mark, $files_by_maint; +global $file_sizes_by_mark; global $missing_files, $missing_tags, $using_rev; // Transform english file name to translated file name @@ -182,7 +185,9 @@ if ([EMAIL PROTECTED]($trans_file)) { $files_by_mark[REV_NOTRANS]++; $trans_name = substr($trans_file, strlen($DOCDIR) + strlen($LANG) + 1); -$missing_files[$trans_name] = array( round(filesize($file)/1024, 1) ); +$size = round(filesize($file)/1024, 1); +$missing_files[$trans_name] = array( $size ); +$file_sizes_by_mark[REV_NOTRANS] += $size; // compute en-tags just if they're needed in the WIP-Table if($using_rev) { $missing_files[$trans_name][] = 1..get_tags($file); @@ -220,6 +225,7 @@ // file in the missing tags list if (count($trans_tag) == 0) { $files_by_mark[REV_NOTAG]++; +$file_sizes_by_mark[REV_NOTAG] += $en_size; $missing_tags[] = array(substr($trans_file, strlen($DOCDIR)), $en_size, $trans_size, $size_diff); return FALSE; } @@ -247,6 +253,7 @@ // Store file by status and maintainer $files_by_mark[REV_UPTODATE]++; $files_by_maint[$this_maint][REV_UPTODATE]++; +$file_sizes_by_mark[REV_UPTODATE] += $en_size; return FALSE; } @@ -268,6 +275,7 @@ // Store files by status, and by maintainer too $files_by_mark[$status_mark]++; $files_by_maint[$this_maint][$status_mark]++; +$file_sizes_by_mark[$status_mark] += $en_size; return array( full_name = $file, @@ -679,10 +687,13 @@ thFile status type/th thNumber of files/th thPercent of files/th +thSize of files (kB)/th +thPercent of size/th /tr END_OF_MULTILINE; $files_sum = array_sum($files_by_mark); +$file_sizes_sum = array_sum($file_sizes_by_mark); $file_types = array( array (REV_UPTODATE, Up to date files), @@ -699,10 +710,13 @@ td.$type[1]./td. td class=c.intval($files_by_mark[$type[0]])./td. td class=c.number_format($files_by_mark[$type[0]] * 100 / $files_sum, 2 ). - %/td/tr\n; + %/td. + td class=c.intval($file_sizes_by_mark[$type[0]])./td. + td class=c.number_format($file_sizes_by_mark[$type[0]] * 100 / $file_sizes_sum, 2). + %/td/tr\n; } - print tr class=bluethFiles total/thth$files_sum/thth100%/th/tr\n. + print tr class=bluethFiles total/thth$files_sum/thth100%/thth$file_sizes_sum/thth100%/th/tr\n. /table\npnbsp;/p\n; } @@ -923,7 +937,7 @@ $prev_dir = $new_dir; } -print tr class=wiptd$short_file/td . +print tr class=wiptda href=\http://cvs.php.net/co.php/phpdoc/en/$file\;$short_file/a/td . td class=r$info[0]/td/tr\n; } print /table\npnbsp;/p\n$navbarpnbsp;/p\n; @@ -933,4 +947,4 @@ // All OK, end the file print /body\n/html\n; -? \ No newline at end of file +? -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
tom Sun Dec 22 04:45:57 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: next try to fix the dir-prob. Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.33 phpdoc/scripts/revcheck.php:1.34 --- phpdoc/scripts/revcheck.php:1.33Sat Dec 14 07:57:45 2002 +++ phpdoc/scripts/revcheck.php Sun Dec 22 04:45:57 2002 @@ -90,12 +90,13 @@ // Main directory of the PHP documentation (depends on the // sapi used). We do need the trailing slash! -$sapi_type = php_sapi_name(); -if ($sapi_type === cli){ -$DOCDIR = ./; - }else { -$DOCDIR = ../; -} +if (cli === php_sapi_name()) { + if (isset($PHPDOCDIR) is_dir($PHPDOCDIR)) + $DOCDIR = $PHPDOCDIR./; + else + $DOCDIR = ./; +} else + $DOCDIR = ../; // = // Functions to get revision info and credits from a file -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
betzSat Dec 14 07:57:45 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: sapi_type check because of the different behavior of the cli and cgi version Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.32 phpdoc/scripts/revcheck.php:1.33 --- phpdoc/scripts/revcheck.php:1.32Fri Nov 1 04:52:43 2002 +++ phpdoc/scripts/revcheck.php Sat Dec 14 07:57:45 2002 @@ -88,11 +88,15 @@ $MAINT = ; } -// Main directory of the PHP documentation (one dir up -// in cvs). We do need the trailing slash! -$DOCDIR = ../; +// Main directory of the PHP documentation (depends on the +// sapi used). We do need the trailing slash! +$sapi_type = php_sapi_name(); +if ($sapi_type === cli){ +$DOCDIR = ./; + }else { +$DOCDIR = ../; +} - // = // Functions to get revision info and credits from a file // = @@ -534,11 +538,11 @@ td,a,p { color:#00; } h2 { font-size:28px; } th { font-weight:bold; } -.blue { background-color:#99; } -.act { background-color:#68D888; } +.blue { background-color:#99; } +.act { background-color:#68D888; } .norev { background-color:#f4a460; } .old { background-color:#eee8aa; } -.crit { background-color:#ff6347; } +.crit { background-color:#ff6347; } .wip { background-color:#dcdcdc; } .r { text-align:right } .rb{ text-align:right; font-weight:bold; } -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
tom Fri Nov 1 04:52:44 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: speed up the stuff, let navbar only link to really shown sections, a small reduction of html-size Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.31 phpdoc/scripts/revcheck.php:1.32 --- phpdoc/scripts/revcheck.php:1.31Wed Oct 23 16:26:27 2002 +++ phpdoc/scripts/revcheck.php Fri Nov 1 04:52:43 2002 -92,23 +92,14 // in cvs). We do need the trailing slash! $DOCDIR = ../; -$navbar = p class=ca href=\#intro\Introduction/a | . - a href=\#translators\Translators/a | . - a href=\#filesummary\File summary by type/a | . - a href=\#files\Files/a | . - a href=\#wip\Work in progress/a | . - a href=\#misstags\Missing revision numbers/a | . - a href=\#missfiles\Untranslated files/a/p\n; - // = // Functions to get revision info and credits from a file // = -// Grabs the revision tag from the file given -function get_tag($file, $val = en-rev) +// Grabs the revision tag and stores credits from the file given +function get_tags($file, $val = en-rev) { - // Read the first 500 chars. The comment should be at // the begining of the file $fp = fopen($file, r) or die (Unable to read $file.); -121,7 +112,27 preg_match(/!-- .Revision: \d+\.(\d+) . --/, $line, $match); return $match[1]; } + +// Handle credits (only if no maintainer is specified) +if ($val == \\S*) { +global $files_by_maint; + +// Find credits info, let more credits then one, +// using commas as list separator +if (preg_match('!--\s*CREDITS:\s*(.+)\s*--'U, $line, $match_credit)) { + +// Explode with commas a separators +$credits = explode(,, $match_credit[1]); + +// Store all elements +foreach ($credits as $num = $credit) { +$files_by_maint[trim($credit)][REV_CREDIT]++; +} + +} +} + // No match before the preg $match = array(); -145,240 +156,117 // Return with found revision info (number, maint, status) return $match; -} // get_tag() function end - -// Grab CREDITS tag, the place to store previous credits -function get_credits ($file) { - -// Read the first 500 chars, the comment should be at -// the begining of the file, if it is there -$fp = fopen($file, r) or die (Unable to read $file.); -$line = fread($fp, 500); -fclose($fp); - -// Try to find credits info in file, let more credits -// then one, using commas as list separator -if (preg_match('!--\s*CREDITS:\s*(.+)\s*--'U, - $line, - $match)) { - - // Explode with commas a separators - $credits = explode(,, $match[1]); - - // Trim all elements (let spaces to be - // between credit info) - foreach ($credits as $num = $credit) { - $credits[$num] = trim($credit); - } - - return $credits; - -} else { - - // No credits info in this file - return array(); -} +} // get_tags() function end -} // get_credits() end // = // Functions to check file status in translated directory, and store info // = -// Collect or return missing files depending on -// the parameters passed to this function -function missing_file() -{ -// Static var to store info, and return if asked -static $missing_files = array(); -global $DOCDIR, $LANG; - -// Return with the missing files, -// in case of no parameters to this function -if (func_num_args() == 0) { -return $missing_files; -} - -// Get the parameters if we have them -list($en_file, $trans_file) = func_get_args(); - -// Compute new index for missing file (name without language dir) -$index = substr($trans_file, strlen($DOCDIR) + strlen($LANG) + 1); - -// Compute new value for missing file (size and EN revision) -$value = array( -round(filesize($en_file)/1024, 1), -1. . get_tag($en_file) -); - -// Push file into array -$missing_files[$index] = $value; - -} // missing_file() function end - -// Collect or return files with missing tags depending on -// the parameters passed to this function -function missing_tag() -{ -// Static var to store info, and return if asked -static $missing_tags = array(); -global $DOCDIR; - -// Return with the file with missing tags, -// in case of no parameters to this function -if (func_num_args() == 0) { -return
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
+print END_OF_MULTILINE +p class=ca href=#introIntroduction/a | +a href=#translatorsTranslators/a | +a href=#filesummaryFile summary by type/a | +a href=#filesFiles/a | +a href=#wipWork in progress/a | +a href=#misstagsMissing revision numbers/a | +a href=#missfilesUntranslated files/a +/p +pnbsp;/p +END_OF_MULTILINE; Please please put this into a variable or function, do not copy paste code 10 times! Goba
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
Hi Goba, you're fully right (I was just driven by the still too large html-output before I went to bed, without thinking about anything :). I have to leave now, but I'll change that tomorrow. Cu, Thomas Gabor Hojtsy wrote: +print END_OF_MULTILINE +p class=ca href=#introIntroduction/a | +a href=#translatorsTranslators/a | +a href=#filesummaryFile summary by type/a | +a href=#filesFiles/a | +a href=#wipWork in progress/a | +a href=#misstagsMissing revision numbers/a | +a href=#missfilesUntranslated files/a +/p +pnbsp;/p +END_OF_MULTILINE; Please please put this into a variable or function, do not copy paste code 10 times! Goba
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
tom Fri Apr 26 18:33:30 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: - took functions.xml (temporarily) out of statistics,\n- introduced directory-headers also for files without rev-comments and available for translation (since this alone reduces HTML-space of about 40kB, Ive...)\n- copied the navigation bar to several other places in the HTML-document Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.26 phpdoc/scripts/revcheck.php:1.27 --- phpdoc/scripts/revcheck.php:1.26Mon Apr 22 17:40:42 2002 +++ phpdoc/scripts/revcheck.php Fri Apr 26 18:33:28 2002 -64,8 +64,6 define(REV_CREDIT, 7); // only used in translators list define(REV_WIP, 8); // only used in translators list -define(NORMHEAD, 9); // only used in table outputs (css) - // Colors used to mark files by status (colors for the above types) $CSS = array( REV_UPTODATE = act, -76,7 +74,6 REV_NOTRANS = wip, REV_CREDIT = wip, REV_WIP = wip, - NORMHEAD = blue, ); // Option for the link to cvs.php.net: normal: f=h -415,6 +412,12 if (preg_match(/^\.{1,2}/,$file) || $file == 'CVS') continue; + // JUST TEMPORARY TILL THE TRANSLATION/REFERENCE/FUNCTIONS.XML - ISSUE IS +CLARIFIED + // If we found a file functions.xml in the + // lang/reference/ tree, skip the file + if ($file == functions.xml preg_match(!/\w+/reference/\w+/!, $dir)) +continue; + // Collect files and directories if (is_dir($dir.$file)) { $directories[] = $file; } else { $files[] = $file; } -696,7 +699,7 th class={$CSS[REV_CRITICAL]} style=color:#00critical/th th class={$CSS[REV_NOREV]} style=color:#00norev/th th class={$CSS[REV_WIP]} style=color:#00wip/th -th class={$CSS[NORMHEAD]}sum/th +th class=bluesum/th /tr END_OF_MULTILINE; -819,6 +822,19 } +print END_OF_MULTILINE +p class=ca href=#introIntroduction/a | +a href=#translatorsTranslators/a | +a href=#filesummaryFile summary by type/a | +a href=#filesFiles/a | +a href=#wipWork in progress/a | +a href=#misstagsMissing revision numbers/a | +a href=#missfilesUntranslated files/a +/p +pnbsp;/p +END_OF_MULTILINE; + + // = // Files table goes here // = -893,11 +909,8 $prev_dir = $new_dir; } -// Style attribute for all the cells -$style = 'class=' . $CSS[$file[mark]]; - // Write out the line for the current file (get file name shorter) -print tr $styletd{$file['short_name']}/td. +print tr class={$CSS[$file['mark']]}td{$file['short_name']}/td. td {$file['revision'][0]}/td . td {$file['revision'][1]}/td. td class=rb{$file['revision'][2]}/b /td. -914,6 +927,19 print(/table\npnbsp;/p\n); +print END_OF_MULTILINE +p class=ca href=#introIntroduction/a | +a href=#translatorsTranslators/a | +a href=#filesummaryFile summary by type/a | +a href=#filesFiles/a | +a href=#wipWork in progress/a | +a href=#misstagsMissing revision numbers/a | +a href=#missfilesUntranslated files/a +/p +pnbsp;/p +END_OF_MULTILINE; + + // = // Work in progress table goes here // = -981,18 +1007,59 } print /table\npnbsp;/p\n; + +print END_OF_MULTILINE +p class=ca href=#introIntroduction/a | +a href=#translatorsTranslators/a | +a href=#filesummaryFile summary by type/a | +a href=#filesFiles/a | +a href=#wipWork in progress/a | +a href=#misstagsMissing revision numbers/a | +a href=#missfilesUntranslated files/a +/p +pnbsp;/p +END_OF_MULTILINE; + } // Files translated, but without a revision comment $count = count($missing_tags); if ($count 0) { print a name=\misstags\/a . - table width=\540\ border=\0\ cellpadding=\3\ cellspacing=\1\ align=\center\\n. + table width=\400\ border=\0\ cellpadding=\3\ cellspacing=\1\ +align=\center\\n. trth class=bluebFiles without Revision-comment ($count files):/b/th/tr\n; foreach($missing_tags as $val) { -print trtd class=miss$val/td/tr\n; +// Shorten the filename (we have directory headers) +$short_file = basename($val); + +// Guess the new directory from the full name of the file +$new_dir = substr($val, 0, strrpos($val, /)); + +// If this is a new directory, put out dir headline +if ($new_dir != $prev_dir) { + +// Print out directory header +print tr class=blueth.dirname($val)./th/tr\n; + +// Store the new actual directory +$prev_dir = $new_dir; +} +print trtd class=miss$short_file/td/tr\n; } print /table\npnbsp;/p\n; + +
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
tom Mon Apr 22 17:40:44 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: small reduction of HMTL-size Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.25 phpdoc/scripts/revcheck.php:1.26 --- phpdoc/scripts/revcheck.php:1.25Sun Apr 21 12:32:23 2002 +++ phpdoc/scripts/revcheck.php Mon Apr 22 17:40:42 2002 -76,7 +76,7 REV_NOTRANS = wip, REV_CREDIT = wip, REV_WIP = wip, - NORMHEAD = normhead, + NORMHEAD = blue, ); // Option for the link to cvs.php.net: normal: f=h -624,36 +624,33 meta http-equiv=Content-Type content=text/html; charset={$charset} style type=text/css !-- - h2,td,a,p,a.ref,th,.hl { font-family: Arial,Helvetica,sans-serif; font-size: 14px; } - h2, th, a.ref { color: #FF; } - td,a,p{ color: #00; } - h2{ font-size: 28px; } - th{ font-weight: bold; } - th.blue { background-color: #99; } - .act { background-color: #68D888; } - .norev{ background-color: #f4a460; } - .old { background-color: #eee8aa; } - .crit { background-color: #ff6347; } - .normhead { background-color: #99; color: #ff; } - .wip { background-color: #dcdcdc; } - .miss { background-color: #dd; } - .hl { color: #00; font-weight: bold; } - body { margin: 0px 0px 0px 0px; } +h2,td,a,p,a.ref,th { font-family:Arial,Helvetica,sans-serif; font-size:14px; } +h2,th,a.ref { color:#FF; } +td,a,p { color:#00; } +h2 { font-size:28px; } +th { font-weight:bold; } +.blue { background-color:#99; } +.act { background-color:#68D888; } +.norev { background-color:#f4a460; } +.old { background-color:#eee8aa; } +.crit { background-color:#ff6347; } +.wip { background-color:#dcdcdc; } +.miss { background-color:#dd; } +.r { text-align:right } +.c { text-align:center } +body { margin:0px 0px 0px 0px; background-color:#F0F0F0; } //-- /style /head -body bgcolor=#F0F0F0 +body table width=100% border=0 cellspacing=0 bgcolor=#99 trtd - table width=100% border=0 cellspacing=1 bgcolor=#CC - trtdh2 align=centerStatus of the translated PHP Manual/h2 - p align=center style=font-size:12px; - Generated: {$date} nbsp; / nbsp; Language: $LANGbr/p - /td/tr - /table +table width=100% border=0 cellspacing=1 bgcolor=#CC +trtdh2 class=cStatus of the translated PHP Manual/h2p class=c +style=font-size:12px;Generated: {$date} nbsp; / nbsp; Language: +$LANGbr/p/td/tr +/table /td/tr /table -p align=centera href=#introIntroduction/a | +p class=ca href=#introIntroduction/a | a href=#translatorsTranslators/a | a href=#filesummaryFile summary by type/a | a href=#filesFiles/a | -670,7 +667,7 // If we have an introduction text, print it out, with an anchor if (!empty($translation[intro])) { print 'a name=intro/a'; -print 'table width=800 align=centertrtd align=center' . +print 'table width=800 align=centertrtd class=c' . $translation['intro'] . '/td/tr/tablep/p'; } -686,20 +683,20 a name=translators/a table width=820 border=0 cellpadding=4 cellspacing=1 align=center tr - th rowspan=2 class=blueTranslator's name/th - th rowspan=2 class=blueContact email/th - th rowspan=2 class=blueNick/th - th rowspan=2 class=blueCVS/th - th colspan=7 class=blueFiles maintained/th +th rowspan=2 class=blueTranslator's name/th +th rowspan=2 class=blueContact email/th +th rowspan=2 class=blueNick/th +th rowspan=2 class=blueCVS/th +th colspan=7 class=blueFiles maintained/th /tr tr - th class={$CSS[REV_CREDIT]} style=color:#00credits/th - th class={$CSS[REV_UPTODATE]} style=color:#00uptodate/th - th class={$CSS[REV_OLD]} style=color:#00old/th - th class={$CSS[REV_CRITICAL]} style=color:#00critical/th - th class={$CSS[REV_NOREV]} style=color:#00norev/th - th class={$CSS[REV_WIP]} style=color:#00wip/th - th class={$CSS[NORMHEAD]}sum/th +th class={$CSS[REV_CREDIT]} style=color:#00credits/th +th class={$CSS[REV_UPTODATE]} style=color:#00uptodate/th +th class={$CSS[REV_OLD]} style=color:#00old/th +th class={$CSS[REV_CRITICAL]} style=color:#00critical/th +th class={$CSS[REV_NOREV]} style=color:#00norev/th +th class={$CSS[REV_WIP]} style=color:#00wip/th +th class={$CSS[NORMHEAD]}sum/th /tr END_OF_MULTILINE; -725,10 +722,10 // Decide on the CVS text and the color of the line if ($person[cvs] === yes) { $cvsu = x; -$col = 'old'; +$col = old; } else { $cvsu = nbsp;; -$col = 'wip'; +$col = wip; } // Try to do some antispam actions -747,16 +744,16 print(tr class=$col . tda name=\maint$num\$person[name]/a/td . - td$person[email]nbsp;/td . + td$person[email]/td .
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
tom Sun Apr 21 12:32:23 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: enlarged table-widths to fit longer filenames; some changes for a bit smaller HTML-output (eg. de 379kB - 262kB) Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.24 phpdoc/scripts/revcheck.php:1.25 --- phpdoc/scripts/revcheck.php:1.24Mon Apr 15 15:18:25 2002 +++ phpdoc/scripts/revcheck.php Sun Apr 21 12:32:23 2002 -68,15 +68,15 // Colors used to mark files by status (colors for the above types) $CSS = array( - REV_UPTODATE = background-color: #68D888; color: #00;, - REV_NOREV= background-color: #f4a460; color: #00;, - REV_CRITICAL = background-color: #ff6347; color: #00;, - REV_OLD = background-color: #eee8aa; color: #00;, - REV_NOTAG= background-color: #dcdcdc; color: #00;, - REV_NOTRANS = background-color: #dcdcdc; color: #00;, - REV_CREDIT = background-color: #dcdcdc; color: #00;, - REV_WIP = background-color: #dcdcdc; color: #00;, - NORMHEAD = background-color: #99; color: #ff;, + REV_UPTODATE = act, + REV_NOREV= norev, + REV_CRITICAL = crit, + REV_OLD = old, + REV_NOTAG= wip, + REV_NOTRANS = wip, + REV_CREDIT = wip, + REV_WIP = wip, + NORMHEAD = normhead, ); // Option for the link to cvs.php.net: normal: f=h -624,14 +624,21 meta http-equiv=Content-Type content=text/html; charset={$charset} style type=text/css !-- -h2, td, a, p, a.ref, th, .hl { -font-family: Arial,Helvetica,sans-serif; color: #FF; font-size: 14px; -} -h2 { font-size: 28px; } -td,a,p, th.black { color: #00; } -th { font-weight: bold; } -.hl { color: #00; font-weight: bold; } -body { margin: 0px 0px 0px 0px; } + h2,td,a,p,a.ref,th,.hl { font-family: Arial,Helvetica,sans-serif; font-size: 14px; } + h2, th, a.ref { color: #FF; } + td,a,p{ color: #00; } + h2{ font-size: 28px; } + th{ font-weight: bold; } + th.blue { background-color: #99; } + .act { background-color: #68D888; } + .norev{ background-color: #f4a460; } + .old { background-color: #eee8aa; } + .crit { background-color: #ff6347; } + .normhead { background-color: #99; color: #ff; } + .wip { background-color: #dcdcdc; } + .miss { background-color: #dd; } + .hl { color: #00; font-weight: bold; } + body { margin: 0px 0px 0px 0px; } //-- /style /head -679,20 +686,20 a name=translators/a table width=820 border=0 cellpadding=4 cellspacing=1 align=center tr - th rowspan=2 bgcolor=#99Translator's name/th - th rowspan=2 bgcolor=#99Contact email/th - th rowspan=2 bgcolor=#99Nick/th - th rowspan=2 bgcolor=#99CVS/th - th colspan=7 bgcolor=#99Files maintained/th + th rowspan=2 class=blueTranslator's name/th + th rowspan=2 class=blueContact email/th + th rowspan=2 class=blueNick/th + th rowspan=2 class=blueCVS/th + th colspan=7 class=blueFiles maintained/th /tr tr - th style={$CSS[REV_CREDIT]}credits/th - th style={$CSS[REV_UPTODATE]}uptodate/th - th style={$CSS[REV_OLD]}old/th - th style={$CSS[REV_CRITICAL]}critical/th - th style={$CSS[REV_NOREV]}norev/th - th style={$CSS[REV_WIP]}wip/th - th style={$CSS[NORMHEAD]}sum/th + th class={$CSS[REV_CREDIT]} style=color:#00credits/th + th class={$CSS[REV_UPTODATE]} style=color:#00uptodate/th + th class={$CSS[REV_OLD]} style=color:#00old/th + th class={$CSS[REV_CRITICAL]} style=color:#00critical/th + th class={$CSS[REV_NOREV]} style=color:#00norev/th + th class={$CSS[REV_WIP]} style=color:#00wip/th + th class={$CSS[NORMHEAD]}sum/th /tr END_OF_MULTILINE; -718,10 +725,10 // Decide on the CVS text and the color of the line if ($person[cvs] === yes) { $cvsu = x; -$col = '#eee8aa'; +$col = 'old'; } else { $cvsu = nbsp;; -$col = '#dcdcdc'; +$col = 'wip'; } // Try to do some antispam actions -738,18 +745,18 $pi = array(); } -print(tr bgcolor=$col . +print(tr class=$col . tda name=\maint$num\$person[name]/a/td . td$person[email]nbsp;/td . td$person[nick]nbsp;/td . - td align=\center\$cvsunbsp;/td . + td align=\center\$cvsu/td . td align=\center\ . $pi[REV_CREDIT] . nbsp;/td . td align=\center\ . $pi[REV_UPTODATE] . nbsp;/td . td align=\center\ . $pi[REV_OLD] . nbsp;/td . td align=\center\ . $pi[REV_CRITICAL] . nbsp;/td . td align=\center\ . $pi[REV_NOREV]. nbsp;/td . td align=\center\ . $pi[REV_WIP] . nbsp;/td . -
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaMon Apr 15 15:18:25 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: Some modifications for the new system: a) Ignore the old functions directory for revchecks b) Find Revision headers in the first 500 chars not the first 200 (this finds rev headers after all the comments added by the autosplit code) c) Use the basename of files for printouts (we have directory headers with directory names, the filenames are not absolutely but quite unique). $Revision CVS tags are missing from EN function files, so the revcheck output it still not too meaningful (but huge). We need to add some ideas about how it can be made much smaller. One method is to keep all translations up to date and translate any modifications from the english tree immediately ;)) That would result in a small revcheck file. But in reality, we need to do something about the size. It's 1,1M for the hu tree. Something like a revcheck.html.gz file would do more for now. Zipping this up with Winzip results in a 37Kb file, so GZ should be more enough ;))) Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.23 phpdoc/scripts/revcheck.php:1.24 --- phpdoc/scripts/revcheck.php:1.23Fri Mar 29 13:48:02 2002 +++ phpdoc/scripts/revcheck.php Mon Apr 15 15:18:25 2002 -103,10 +103,10 function get_tag($file, $val = en-rev) { -// Read the first 200 chars. The comment should be at +// Read the first 500 chars. The comment should be at // the begining of the file $fp = fopen($file, r) or die (Unable to read $file.); -$line = fread($fp, 200); +$line = fread($fp, 500); fclose($fp); // Check for English CVS revision tag (. is for $ in the preg!), -144,10 +144,10 // Grab CREDITS tag, the place to store previous credits function get_credits ($file) { -// Read the first 300 chars, the comment should be at +// Read the first 500 chars, the comment should be at // the begining of the file, if it is there $fp = fopen($file, r) or die (Unable to read $file.); -$line = fread($fp, 300); +$line = fread($fp, 500); fclose($fp); // Try to find credits info in file, let more credits -394,7 +394,12 // The English directory is passed to this function to check function get_dir_status($dir, $DOCDIR, $LANG) { - +// If this is an old functions directory +// (not under reference) then do not travers +if (preg_match(!/en/functions!, $dir)) { +return array(); +} + // Collect files and diretcories in these arrays $directories = array(); $files = array(); -862,7 +867,10 preg_replace( '^.$DOCDIR.', phpdoc/, $file[full_name]) . ?r1= . $file[revision][1] . amp;r2= . $file[revision][0] . - CVS_OPT . \ . $file[short_name] . /a; + CVS_OPT . \ . basename($file[short_name]) . +/a; +} else { +// Else just shorten the filename (we have directory headers) +$file[short_name] = basename($file[short_name]); } // Guess the new directory from the full name of the file -884,7 +892,7 // Style attribute for all the cells $style = 'style=' . $CSS[$file[mark]] . ''; -// Write out the line for the current file +// Write out the line for the current file (get file name shorter) print tr\n td $style{$file['short_name']}/td\n. td $style {$file['revision'][0]}/td . td $style {$file['revision'][1]}/td\n.
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaFri Mar 29 13:48:02 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: Add 1. to N/A revision number files' English rev too Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.22 phpdoc/scripts/revcheck.php:1.23 --- phpdoc/scripts/revcheck.php:1.22Mon Mar 25 17:55:31 2002 +++ phpdoc/scripts/revcheck.php Fri Mar 29 13:48:02 2002 -332,17 +332,18 $trans_name = substr($trans_file, strlen($DOCDIR) + strlen($LANG) + 1); // Get English file revision for revision computing -$en_rev = get_tag($file); +$en_rev = get_tag($file); // If we have a numeric revision number (not n/a), compute rev. diff if (is_numeric($this_rev)) { -$rev_diff = intval($en_rev) - intval($this_rev); +$rev_diff = intval($en_rev) - intval($this_rev); $trans_rev = 1.{$this_rev}; $en_rev = 1.{$en_rev}; } else { // If we have no numeric revision, make all revision // columns hold the rev from the translated file $rev_diff = $trans_rev = $this_rev; + $en_rev = 1.{$en_rev}; } // Compute sizes, times and diffs
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaSun Mar 24 05:09:36 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: Some commented debug parts deleted, Actual = Up to date, and do not print out full files summary table if only a maintainer is asked for. Adding 100% entry to files summary table, and changed color of sum column in translators table. Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.19 phpdoc/scripts/revcheck.php:1.20 --- phpdoc/scripts/revcheck.php:1.19Sat Mar 23 17:44:02 2002 +++ phpdoc/scripts/revcheck.php Sun Mar 24 05:09:35 2002 -54,7 +54,7 define(ALERT_DATE, -30); // translation is 30 or more days older than the en one // Revision marks used to flag files -define(REV_ACTUAL, 1); // actual file +define(REV_UPTODATE, 1); // actual file define(REV_NOREV,2); // file with revision comment without revision define(REV_CRITICAL, 3); // criticaly old / small / outdated define(REV_OLD, 4); // outdated file -68,9 +68,9 // Colors used to mark files by status (colors for the above types) $CSS = array( - REV_ACTUAL = background-color: #68D888; color: #00;, + REV_UPTODATE = background-color: #68D888; color: #00;, REV_NOREV= background-color: #f4a460; color: #00;, - REV_CRITICAL = background-color: #ff6347; color: #00;, #ff + REV_CRITICAL = background-color: #ff6347; color: #00;, REV_OLD = background-color: #eee8aa; color: #00;, REV_NOTAG= background-color: #dcdcdc; color: #00;, REV_NOTRANS = background-color: #dcdcdc; color: #00;, -354,7 +354,7 // Make decision on file category by revision, date and size if ($rev_diff === 0) { -$status_mark = REV_ACTUAL; +$status_mark = REV_UPTODATE; } elseif ($rev_diff === n/a) { $status_mark = REV_NOREV; } elseif ($rev_diff = ALERT_REV || $size_diff = ALERT_SIZE || $date_diff = ALERT_DATE) { -654,8 +654,9 // If we have an introduction text, print it out, with an anchor if (!empty($translation[intro])) { -print('a name=intro/a'); -print('table width=800 align=centertrtd' . $translation['intro'] . '/td/tr/tablep/p'); +print 'a name=intro/a'; +print 'table width=800 align=centertrtd align=center' . + $translation['intro'] . '/td/tr/tablep/p'; } // = -678,7 +679,7 /tr tr th style={$CSS[REV_CREDIT]}credits/th - th style={$CSS[REV_ACTUAL]}actual/th + th style={$CSS[REV_UPTODATE]}uptodate/th th style={$CSS[REV_OLD]}old/th th style={$CSS[REV_CRITICAL]}critical/th th style={$CSS[REV_NOREV]}norev/th -735,12 +736,12 td$person[nick]nbsp;/td . td align=\center\$cvsunbsp;/td . td align=\center\ . $pi[REV_CREDIT] . nbsp;/td . - td align=\center\ . $pi[REV_ACTUAL] . nbsp;/td . + td align=\center\ . $pi[REV_UPTODATE] . nbsp;/td . td align=\center\ . $pi[REV_OLD] . nbsp;/td . td align=\center\ . $pi[REV_CRITICAL] . nbsp;/td . td align=\center\ . $pi[REV_NOREV]. nbsp;/td . td align=\center\ . $pi[REV_WIP] . nbsp;/td . - td align=\center\ . array_sum($pi). nbsp;/td . + th bgcolor=\#99\ . array_sum($pi). nbsp;/th . /tr\n); } -751,6 +752,10 // Files summary table goes here // = +// Do not print out file summary table, if we are printing out a page +// for only one maintainer (his personal summary is in the table above) +if (empty($MAINT)) { + print END_OF_MULTILINE a name=filesummary/a table width=450 border=0 cellpadding=4 cellspacing=1 align=center -761,25 +766,25 /tr END_OF_MULTILINE; -$files_sum = array_sum($files_by_mark); - -$file_types = array( - array (REV_ACTUAL, Actual files), - array (REV_OLD, Old files), - array (REV_CRITICAL, Critical files), - array (REV_WIP, Work in progress), - array (REV_NOREV,Files without revision number), - array (REV_NOTAG,Files without revision tag), - array (REV_NOTRANS, Files available for translation) -); - -foreach ($file_types as $num = $type) { -$type[] = 'style=' . $CSS[$type[0]] . ''; -$type[] = intval($files_by_mark[$type[0]]); -$type[] = number_format( -$files_by_mark[$type[0]] * 100 / $files_sum, 2 +$files_sum = array_sum($files_by_mark); + +$file_types = array( + array (REV_UPTODATE, Up to date files), + array (REV_OLD, Old files), + array (REV_CRITICAL, Critical files), + array (REV_WIP, Work in progress), + array (REV_NOREV,Files without revision number), + array (REV_NOTAG,Files without revision tag), + array (REV_NOTRANS, Files available for translation) ); +foreach ($file_types as $num = $type) {
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaSun Mar 24 05:21:32 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: Moving credits check before maintainer check, so we can also count credits in case somone only ask for a specific maintainer Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.20 phpdoc/scripts/revcheck.php:1.21 --- phpdoc/scripts/revcheck.php:1.20Sun Mar 24 05:09:35 2002 +++ phpdoc/scripts/revcheck.php Sun Mar 24 05:21:32 2002 -288,6 +288,14 return FALSE; } +// Get credits from file and collect it +$this_credits = get_credits($trans_file); + +// Add credits to file by maintainer list +foreach ($this_credits as $nick) { +files_by_maint(REV_CREDIT, $nick); +} + // If we need to check for a specific translator if (!empty($MAINT)) { // Get translated files tag, with maintainer -319,12 +327,6 // Distribute values in separate vars for further processing list(, $this_rev, $this_maint, $this_status) = $trans_tag; -$this_credits = get_credits($trans_file); - -// Add credits to file by maintainer list -foreach ($this_credits as $nick) { -files_by_maint(REV_CREDIT, $nick); -} // Get translated file name (without directories) $trans_name = substr($trans_file, strlen($DOCDIR) + strlen($LANG) + 1);
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
Renewed revcheck code, separated logic from presentation [mostly], added color types, revision types, colors to translators table, a new file summary table, removed green files, etc... WOW! Thanx fot this great work! Please test, there may be some problems under the hood, though it seems OK for the hu translation without maintainer restrictions... Congratulations, this document validates as HTML 4.01 Transitional! ;) Seems to be no work for me ;) I dint have the time yet to test it, but the build on php.net for the German translation looks great. Mark -- German Gabber Network http://www.gabber.de Infos und Tips zu PHP http://www.php-homepage.de
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaSat Mar 23 17:44:03 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: Renewed revcheck code, separated logic from presentation [mostly], added color types, revision types, colors to translators table, a new file summary table, removed green files, etc... Please test, there may be some problems under the hood, though it seems OK for the hu translation without maintainer restrictions... Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.18 phpdoc/scripts/revcheck.php:1.19 --- phpdoc/scripts/revcheck.php:1.18Fri Mar 22 18:30:33 2002 +++ phpdoc/scripts/revcheck.php Sat Mar 23 17:44:02 2002 -34,14 +34,6 If you specify maintainer, the script only checks the files maintaned by the person you add here - Revision comment syntax for translated files: - - !-- EN-Revision: 1.34 Maintainer: tom Status: ready -- - - If the revision number is not (yet) known: - - !-- EN-Revision: n/a Maintainer: tom Status: working -- - Read more about Revision comments and related funcionality in the PHP Documentation Howto. -53,206 +45,365 exit; } - // CONFIG SECTION - $docdir = ../; // Main directory of the PHP documentation (one dir up in cvs) +// Long runtime +set_time_limit(0); + +// A file is criticaly outdated' if +define(ALERT_REV, 10); // translation is 10 or more revisions behind the en one +define(ALERT_SIZE, 10); // translation is 10 or more kB smaller than the en one +define(ALERT_DATE, -30); // translation is 30 or more days older than the en one + +// Revision marks used to flag files +define(REV_ACTUAL, 1); // actual file +define(REV_NOREV,2); // file with revision comment without revision +define(REV_CRITICAL, 3); // criticaly old / small / outdated +define(REV_OLD, 4); // outdated file +define(REV_NOTAG,5); // file without revision comment +define(REV_NOTRANS, 6); // file without translation + +define(REV_CREDIT, 7); // only used in translators list +define(REV_WIP, 8); // only used in translators list + +define(NORMHEAD, 9); // only used in table outputs (css) + +// Colors used to mark files by status (colors for the above types) +$CSS = array( + REV_ACTUAL = background-color: #68D888; color: #00;, + REV_NOREV= background-color: #f4a460; color: #00;, + REV_CRITICAL = background-color: #ff6347; color: #00;, #ff + REV_OLD = background-color: #eee8aa; color: #00;, + REV_NOTAG= background-color: #dcdcdc; color: #00;, + REV_NOTRANS = background-color: #dcdcdc; color: #00;, + REV_CREDIT = background-color: #dcdcdc; color: #00;, + REV_WIP = background-color: #dcdcdc; color: #00;, + NORMHEAD = background-color: #99; color: #ff;, +); + +// Option for the link to cvs.php.net: normal: f=h +// long diff: f=hnum=10, unified (text): f=u +define(CVS_OPT, amp;f=hamp;num=10); + +// Initializing variables from parameters +$LANG = $argv[1]; +if ($argc == 3) { +$MAINT = $argv[2]; +} else { +$MAINT = ; +} - // Warn with red color if - $r_alert = 10; // the translation is $r_alert or more revisions behind the en one - $s_alert = 10; // the translation is $s_alert or more kB smaller than the en one - $t_alert = 30; // the translation is $t_alert or more days older than the en one - - // Option for the link to the cvs.php.net: normal: f=h - // long diff: f=hnum=10, unified (text): f=u - $cvs_opt = amp;f=hamp;num=10; - - /*/ - /* Nothing to modify below this line */ - /*/ - - // Long runtime - set_time_limit(0); - - // Initializing arrays and vars - $missed_files = array(); - $miss_tag = array(); - $t_alert = -1 * $t_alert; - $lang = $argv[1]; - if ($argc == 3) { $maintainer = $argv[2]; } - else { $maintainer = ; } +// Main directory of the PHP documentation (one dir up +// in cvs). We do need the trailing slash! +$DOCDIR = ../; - /*/ - /* Here starts the functions part*/ - /*/ - - // Grabs the revision tag from the file given - function get_tag($file, $val = en-rev) - { +// = +// Functions to get revision info and credits from a file +// = + +// Grabs the revision tag from the file given +function get_tag($file, $val = en-rev) +{ -// Read the first 200 chars, the comment should be at +// Read the first 200 chars. The comment should be at // the begining of the file $fp = fopen($file, r) or die (Unable to read $file.); $line =
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
It think that Actual files is not correct in English. Wouldn't Up-to-date files be better? slawek-
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
mk Fri Mar 22 18:30:34 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: Added myself to the authors Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.17 phpdoc/scripts/revcheck.php:1.18 --- phpdoc/scripts/revcheck.php:1.17Thu Mar 21 07:11:04 2002 +++ phpdoc/scripts/revcheck.php Fri Mar 22 18:30:33 2002 @@ -16,6 +16,7 @@ # +--+ # | Authors:Thomas Schöfbeck [EMAIL PROTECTED] | # | Gabor Hojtsy [EMAIL PROTECTED] | +# | Mark Kronsbein [EMAIL PROTECTED] | # +--+ */ if ($argc 2 || $argc 3) { @@ -44,8 +45,9 @@ Read more about Revision comments and related funcionality in the PHP Documentation Howto. - Authors: Thomas Schöfbeck [EMAIL PROTECTED] | - Gabor Hojtsy [EMAIL PROTECTED] | + Authors: Thomas Schöfbeck [EMAIL PROTECTED] + Gabor Hojtsy [EMAIL PROTECTED] + Mark Kronsbein [EMAIL PROTECTED] ?php exit;
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
cortesi Thu Mar 21 07:11:06 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: adding ability to reference with anchor name the single table very useful since the page is really long Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.16 phpdoc/scripts/revcheck.php:1.17 --- phpdoc/scripts/revcheck.php:1.16Sun Mar 17 05:56:51 2002 +++ phpdoc/scripts/revcheck.php Thu Mar 21 07:11:04 2002 -370,6 +370,7 style type=\text/css\!-- h2 {font-family: Arial,Helvetica,sans-serif; color: #FF; font-size: 28px; } td,a,p {font-family: Arial,Helvetica,sans-serif; color: #00; font-size: 14px; } + a.ref {font-family: Arial,Helvetica,sans-serif; color: #FF; font-size: 14px; } th {font-family: Arial,Helvetica,sans-serif; color: #FF; font-size: 14px; font-weight: bold; } .hl {font-family: Arial,Helvetica,sans-serif; color: #00; font-size: 14px; font-weight: bold; } body {margin-left: 0px; margin-right: 0px; margin-top: 0px; margin-bottom: 0px; } -397,7 +398,7 print( table width=\820\ border=\0\ cellpadding=\4\ cellspacing=\1\ align=\center\ tr - th rowspan=\2\ bgcolor=\#99\Translated file/th + th rowspan=\2\ bgcolor=\#99\a name=\translated\ +class=\ref\Translated file/a/th th colspan=\3\ bgcolor=\#99\Revision/th th colspan=\3\ bgcolor=\#99\Size in kB/th th colspan=\3\ bgcolor=\#99\Age in days/th -432,7 +433,7 print( table width=\820\ border=\0\ cellpadding=\4\ cellspacing=\1\ align=\center\ tr - th bgcolor=\#99\Work in progress files/th + th bgcolor=\#99\a name=\wip\ class=\ref\Work in progress +files/a/th th bgcolor=\#99\Translator/th th bgcolor=\#99\Type/th ); -466,7 +467,7 print( table width=\820\ border=\0\ cellpadding=\4\ cellspacing=\1\ align=\center\ tr - th rowspan=\2\ bgcolor=\#99\Translator's name/th + th rowspan=\2\ bgcolor=\#99\a name=\translators\ +class=\ref\Translator's name/a/th th rowspan=\2\ bgcolor=\#99\Contact email/th th rowspan=\2\ bgcolor=\#99\Nick/th th rowspan=\2\ bgcolor=\#99\CVS/th -526,7 +527,7 $count = count($missed_files); if ($count 0) { print(table width=\440\ border=\0\ cellpadding=\3\ cellspacing=\1\ align=\center\\n. - trth colspan=\2\ bgcolor=\#99\bAvailable for translation ($count files):/b/th/tr\n); + trth colspan=\2\ bgcolor=\#99\ba name=\avail\ +class=\ref\Available for translation/a ($count files):/b/th/tr\n); foreach($missed_files as $file = $info) { print( trtd bgcolor=\#DD\nbsp; $file/td. td align=\right\ bgcolor=\#DD\$info[0] kB nbsp;/td/tr\n);
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
cortesi Thu Mar 21 07:11:06 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: adding ability to reference with anchor name the single table very useful since the page is really long As you are in modifying the code, it would be nice to put up a list of links on the top of the page centered, listing all the tables, giving links to the anchors you created. Goba
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
At 19.38 21/03/02 +0100, Gabor Hojtsy wrote: adding ability to reference with anchor name the single table very useful since the page is really long As you are in modifying the code, it would be nice to put up a list of links on the top of the page centered, listing all the tables, giving links to the anchors you created. Thats no problem! I'll do that tomorrow afternoon (CET). Sorry for not asking permission before touching your file.
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
adding ability to reference with anchor name the single table very useful since the page is really long As you are in modifying the code, it would be nice to put up a list of links on the top of the page centered, listing all the tables, giving links to the anchors you created. Thats no problem! I'll do that tomorrow afternoon (CET). Sorry for not asking permission before touching your file. It's not my file. Anyone can contribute anything to it. As you can see it was actually invented by Thomas Schöfbeck, I addded many things and corrected Thomas' code, so I am one of the authors of that code. BTW I have a plan on adding a new summary table on the weekend (it will be useful I hope). I'll try to follow all the commits till then... Goba
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
Thomas Schöfbeck, I addded many things and corrected Thomas' code, so I am one of the authors of that code. aolMe too/aol SCNR Mark -- German Gabber Network http://www.gabber.de Infos und Tips zu PHP http://www.php-homepage.de
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
Thomas Schöfbeck, I addded many things and corrected Thomas' code, so I am one of the authors of that code. aolMe too/aol SCNR Pls. add yourself to the Authors list then [not in the manual, but in revcheck.php header] ;) Goba
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
Pls. add yourself to the Authors list then [not in the manual, but in revcheck.php header] ;) Well, I actually only converted your HTML to valid HTML 4.01 Mark -- German Gabber Network http://www.gabber.de Infos und Tips zu PHP http://www.php-homepage.de
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
BTW I have a plan on adding a new summary table on the weekend (it will be useful I hope). It would be nice to see some statistics in there: - percent of translated files (KBs): all, actual, old, very old - percent of files (KBs) translated by every translator Maybe some other usefull... slawek-
Re: [PHP-DOC] cvs: phpdoc /scripts revcheck.php
BTW I have a plan on adding a new summary table on the weekend (it will be useful I hope). It would be nice to see some statistics in there: - percent of translated files (KBs): all, actual, old, very old I exactly planned to add this table ;) It would also serve as an excellent legend for the colors used in the table, and a replacement for the overall % count of Rasmus' script. I'll do it this weekend if and when I'll have the time. - percent of files (KBs) translated by every translator Maybe ;) Goba
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
tom Wed Mar 6 16:31:53 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: reduction to 1 maint. works now also for the Trnasl.- + WIP-list Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.14 phpdoc/scripts/revcheck.php:1.15 --- phpdoc/scripts/revcheck.php:1.14Thu Feb 7 16:38:26 2002 +++ phpdoc/scripts/revcheck.php Wed Mar 6 16:31:53 2002 @@ -33,10 +33,6 @@ If you specify maintainer, the script only checks the files maintaned by the person you add here - The script will generate a revcheck.html file in - the same dir, where the script runs, containing the - information about translations - Revision comment syntax for translated files: !-- EN-Revision: 1.34 Maintainer: tom Status: ready -- @@ -48,8 +44,8 @@ Read more about Revision comments and related funcionality in the PHP Documentation Howto. - Written by Thomas Schöfbeck [EMAIL PROTECTED], 2001-08-11 - Adapted to phpdoc, developed further: [EMAIL PROTECTED] + Authors: Thomas Schöfbeck [EMAIL PROTECTED] | + Gabor Hojtsy [EMAIL PROTECTED] | ?php exit; @@ -149,10 +145,17 @@ } // Get translated files tag, with maintainer if needed -if (empty($maintainer)) - $t_tag = get_tag($t_file, \\S*); -else +if (!empty($maintainer)) { $t_tag = get_tag($t_file, $maintainer); + // Don't count other's Tags as missing + if (count($t_tag) == 0) { +$t_tag = get_tag($t_file, \\S*); +if (count($t_tag) 0) + return FALSE; + } +} +else + $t_tag = get_tag($t_file, \\S*); // No tag found if (count($t_tag) == 0) { @@ -320,8 +323,12 @@ $txml = preg_replace(/\\s+/, , $txml); // Get intro text -preg_match(!intro(.+)/intro!s, $txml, $match); -$translation[intro] = trim($match[1]); +if (!empty($maintainer)) +$translation[intro] = Personal Statistics for .$maintainer; +else { +preg_match(!intro(.+)/intro!s, $txml, $match); +$translation[intro] = trim($match[1]); +} // Get encoding for the output preg_match(!\?xml(.+)\?!U, $txml, $match); @@ -329,18 +336,31 @@ $output_charset = $xmlinfo[1][encoding]; // Get persons list -preg_match_all(!person(.+)/\\s?!U, $txml, $matches); +if (!empty($maintainer)) +$pattern = !person([^]+nick=\$maintainer\.+)/\\s?!U; +else +$pattern = !person(.+)/\\s?!U; +preg_match_all($pattern, $txml, $matches); $translation['persons'] = get_attr_array($matches[1]); foreach($translation['persons'] as $num = $person) { $plist[$person[nick]] = $num; } $personinfo = array(); - + // Get files list -preg_match_all(!file(.+)/\\s?!U, $txml, $matches); -$translation['files'] = get_attr_array($matches[1]); +if (!empty($maintainer)) { +preg_match_all(!file([^]+person=\$maintainer\.+)/\\s?!U, $txml, +$matches); +$translation['files'] = get_attr_array($matches[1]); +// get all others to clear out from available files +preg_match_all(!file(.+)/\\s?!U, $txml, $matches); +$wip_others = get_attr_array($matches[1]); +} +else { +preg_match_all(!file(.+)/\\s?!U, $txml, $matches); +$translation['files'] = get_attr_array($matches[1]); +} } - + print( !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.01 Transitional//EN\ \http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\; html @@ -369,7 +389,7 @@ /table br); if (isset($translation[intro])) { -print('table width=800 align=centertrtd' . $translation[intro] . '/td/tr/tablep/p'); +print('table width=800 align=centertrtd' . $translation['intro'] . +'/td/tr/tablep/p'); } ob_start(); @@ -494,6 +514,11 @@ if (isset($wip_files)) { foreach($wip_files as $fname = $one) { if (isset($missed_files[$fname])) { unset($missed_files[$fname]); } + } +} +if (isset($wip_others)) { + foreach($wip_others as $file = $one) { + if (isset($missed_files[$one['name']])) { unset($missed_files[$one['name']]); } } }
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
slawek Tue Jan 29 09:05:33 2002 EDT Modified files: /phpdoc/scripts revcheck.php Log: Removed Done!. Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.12 phpdoc/scripts/revcheck.php:1.13 --- phpdoc/scripts/revcheck.php:1.12Fri Jan 18 14:19:46 2002 +++ phpdoc/scripts/revcheck.php Tue Jan 29 09:05:32 2002 @@ -508,6 +508,5 @@ // All OK, end the file print(/body\n/html\n); -echo Done!\n; ?
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaWed Dec 19 11:13:30 2001 EDT Modified files: /phpdoc/scripts revcheck.php Log: Simple handling of checked out revision numbers (CO-Revision), for a quick comparision with actual English revisions (EN-Revision). Also copy the date to the file table if it is used. Both the date and revision columns nicely degrade if they are not used in the XML file. Also printing out timezone in generation date as requested. Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.7 phpdoc/scripts/revcheck.php:1.8 --- phpdoc/scripts/revcheck.php:1.7 Wed Dec 19 10:46:36 2001 +++ phpdoc/scripts/revcheck.php Wed Dec 19 11:13:30 2001 @@ -58,7 +58,7 @@ set_time_limit(0); // Initializing arrays and vars - $miss_file = array(); + $missed_files = array(); $miss_tag = array(); $t_alert = -1 * $t_alert; $lang = $argv[1]; @@ -119,15 +119,15 @@ function check_file($file, $file_cnt) { // The information is contained in these global arrays and vars -global $miss_file, $miss_tag, $lang, $docdir, $r_alert, +global $missed_files, $miss_tag, $lang, $docdir, $r_alert, $s_alert, $t_alert, $maintainer, $cvs_opt, $plist, $personinfo; // Translated file name check $t_file = preg_replace( '^.$docdir.en/', $docdir.$lang./, $file ); if (!file_exists($t_file)) { - $miss_file[] = array(substr($t_file, strlen($docdir)+strlen($lang)), - round(filesize($file)/1024, 1)); + $missed_files[substr($t_file, strlen($docdir)+strlen($lang)+1)] = +array(round(filesize($file)/1024, 1), get_tag($file)); return FALSE; } @@ -335,7 +335,7 @@ trtd table width=100% border=0 cellspacing=1 bgcolor=#CC trtdh2 align=centerStatus of the translated PHP Manual/h2 - p align=center style=\font-size:12px; color:#FF;\Generated: .date(Y-m-d, H:i:s). + p align=center style=\font-size:12px; color:#FF;\Generated: +.date(Y-m-d, H:i:s T). nbsp; / nbsp; Language: $langbrnbsp;/p /td/tr /table @@ -378,14 +378,21 @@ // If work-in-progress available (valid translation.xml file in lang) if (isset($translation[files])) { + $using_date = FALSE; $using_rev = FALSE; + foreach ($translation[files] as $file) { +if (isset($file[date])) { $using_date = TRUE; } +if (isset($file[revision])) { $using_rev = TRUE; } + } print( table width=750 border=0 cellpadding=4 cellspacing=1 align=center tr th bgcolor=#99Work in progress files/th th bgcolor=#99Translator/th th bgcolor=#99Type/th - /tr ); + if ($using_date) { print (th bgcolor=#99Date/th\n); } + if ($using_rev) { print (th bgcolor=#99CO-Revision/thth +bgcolor=#99EN-Revision/th\n); } + print(/tr\n); foreach($translation[files] as $num = $finfo) { if (isset($plist[$finfo[person]])) { @@ -394,7 +401,10 @@ $maintd = $finfo[person]; } print(tr bgcolor=#DDtd$finfo[name]/td . - td$maintd/tdtd$finfo[type]/td/tr); + td$maintd/tdtd$finfo[type]/td); +if ($using_date) { print(td$finfo[date]/td); } +if ($using_rev) { print(td$finfo[revision]/tdtd1. . +$missed_files[$finfo[name]][1] . /td); } +print(/tr); $personinfo[$finfo[person]][wip]++; $wip_files[$finfo[name]] = TRUE; } @@ -456,19 +466,19 @@ // Clear out work in progress files from available files if (isset($wip_files)) { - foreach($miss_file as $num = $finfo) { -if (isset($wip_files[substr($finfo[0],1)])) { unset($miss_file[$num]); } + foreach($wip_files as $fname = $one) { +if (isset($missed_files[$fname])) { unset($missed_files[$fname]); } } } // Files not translated and not wip -$count = count($miss_file); +$count = count($missed_files); if ($count 0) { print(table width=350 border=0 cellpadding=3 cellspacing=1 align=center\n. trth colspan=2 bgcolor=#99bAvailable for translation ($count files):/b/th/tr\n); - foreach($miss_file as $v) { - print( trtd bgcolor=#DDnbsp; en$v[0]/td. -td align=right bgcolor=#DD$v[1] kB nbsp;/td/tr\n); + foreach($missed_files as $file = $info) { + print( trtd bgcolor=#DDnbsp; $file/td. +td align=right bgcolor=#DD$info[0] kB nbsp;/td/tr\n); } print(/table\npnbsp;/p\n); }
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaWed Dec 19 11:16:04 2001 EDT Modified files: /phpdoc/scripts revcheck.php Log: Better use the RFC date type Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.8 phpdoc/scripts/revcheck.php:1.9 --- phpdoc/scripts/revcheck.php:1.8 Wed Dec 19 11:13:30 2001 +++ phpdoc/scripts/revcheck.php Wed Dec 19 11:16:04 2001 @@ -335,7 +335,7 @@ trtd table width=100% border=0 cellspacing=1 bgcolor=#CC trtdh2 align=centerStatus of the translated PHP Manual/h2 - p align=center style=\font-size:12px; color:#FF;\Generated: .date(Y-m-d, H:i:s T). + p align=center style=\font-size:12px; color:#FF;\Generated: .date(r). nbsp; / nbsp; Language: $langbrnbsp;/p /td/tr /table
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaWed Dec 19 11:31:26 2001 EDT Modified files: /phpdoc/scripts revcheck.php Log: Using charset from XML files encoding, defaults to iso-8859-1 Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.9 phpdoc/scripts/revcheck.php:1.10 --- phpdoc/scripts/revcheck.php:1.9 Wed Dec 19 11:16:04 2001 +++ phpdoc/scripts/revcheck.php Wed Dec 19 11:31:25 2001 @@ -296,6 +296,7 @@ // Used regexps here for parsing to be compatible with // non XML compatible PHP setups $translation_xml = $docdir . $lang . /translation.xml; + $output_charset = 'iso-8859-1'; $translation = array(); if (@file_exists($translation_xml)) { $txml = join(, file($translation_xml)); @@ -305,6 +306,11 @@ preg_match(!intro(.+)/intro!s, $txml, $match); $translation[intro] = trim($match[1]); +// Get encoding for the output +preg_match(!\?xml(.+)\?!U, $txml, $match); +$xmlinfo = get_attr_array($match); +$output_charset = $xmlinfo[1][encoding]; + // Get persons list preg_match_all(!person(.+)/\\s?!U, $txml, $matches); $translation['persons'] = get_attr_array($matches[1]); @@ -321,7 +327,7 @@ print(html head titlePHPDOC Revision-check/title -meta http-equiv=\Content-Type\ content=\text/html; charset=iso-8859-1\ +meta http-equiv=\Content-Type\ content=\text/html; charset=$output_charset\ style type=\text/css\!-- h2 {font-family: arial,helvetica,sans-serif; color: #FF; font-size:28px; } td,a,p {font-family:arial,helvetica,sans-serif; color:#00; font-size:14px; }
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaSat Dec 15 09:10:20 2001 EDT Modified files: /phpdoc/scripts revcheck.php Log: Adding code for processing the translation.xml files in languages. Featuring nice fallback algoritms, so no error will be print out if there is no translation.xml in the language dir (though the enhancements provided by that file won't be accessible). Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.4 phpdoc/scripts/revcheck.php:1.5 --- phpdoc/scripts/revcheck.php:1.4 Sat Nov 10 16:18:52 2001 +++ phpdoc/scripts/revcheck.php Sat Dec 15 09:10:20 2001 @@ -101,7 +101,8 @@ { // The information is contained in these global arrays and vars global $miss_file, $miss_tag, $lang, $docdir, $r_alert, - $s_alert, $t_alert, $maintainer, $cvs_opt; + $s_alert, $t_alert, $maintainer, $cvs_opt, $plist, + $personinfo; // Translated file name check $t_file = preg_replace( '^.$docdir.en/', $docdir.$lang./, $file ); @@ -126,6 +127,12 @@ // Storing values for further processing $maint = $t_tag[2]; $en_rev = get_tag($file); + +if (isset($plist[$maint])) { + $maintd = 'a href=#maint' . $plist[$maint] . '' . $maint . '/a'; +} else { + $maintd = $maint; +} // Make diff link if the revision is not n/a $t_td = substr($t_file, strlen($docdir)+strlen($lang)+1); @@ -152,12 +159,16 @@ // Taging actuality of files with colors if ($r_diff === 0) { $col = #68D888; + $personinfo[$maint][actual]++; } elseif ($r_diff == n/a) { $col = #f4a460 class=hl; + $personinfo[$maint][norev]++; } elseif ($r_diff = $r_alert || $s_diff = $s_alert || $t_diff = $t_alert) { $col = #ff class=hl; + $personinfo[$maint][veryold]++; } else { $col =#eee8aa; + $personinfo[$maint][old]++; } // Write out directory headline @@ -176,7 +187,7 @@ td bgcolor=$col align=right$en_date nbsp;/td\n. td bgcolor=$col align=right$t_date nbsp;/td\n. td bgcolor=$col align=rightb$t_diff/b nbsp;/td\n. - td bgcolor=$col align=center$maint/td\n. + td bgcolor=$col align=center$maintd/td\n. td bgcolor=$col align=center$t_tag[3]/td\n/tr\n); return TRUE; } // check_file() end @@ -227,7 +238,45 @@ // Check for directory validity if (!@is_dir($docdir . $lang)) { die(The $lang language code is not valid); - } + } + + // Used regexps here for parsing to be compatible with + // non XML compatible PHP setups + $translation_xml = $docdir . $lang . /translation.xml; + $translation = array(); + if (@file_exists($translation_xml)) { +$txml = join(, file($translation_xml)); + +// Process main structure +preg_match(!translation\\s+intro(.+)/intro\\s+ . + translators(.+)/translators\\s+ . + work-in-progress(.+)/work-in-progress . + \\s+/translation!s, $txml, $match); +$translation[intro] = trim($match[1]); + +// Common preg pieces: space and quote +$s = \\s*; $q = '\\s*[\']\\s*'; + +// Process person list +$plist = array(); +preg_match_all(!person${s}name${s}=${q}(.+)${q}email${s}=${q}(.+)${q}. + nick${s}=${q}(.+)${q}(cvs${s}=${q}.+${q}|${s})/${s}!U, +$match[2], $persons, PREG_SET_ORDER); +foreach($persons as $num = $person) { +if (strstr($person[4], yes)) { $persons[$num][4] = TRUE; } +else { $persons[$num][4] = FALSE; } +$plist[$person[3]] = $num; +} +$translation[persons] = $persons; +unset($persons); +$personinfo = array(); + +// Process work-in-progress list +preg_match_all(!file${s}name${s}=${q}(.+)${q}person${s}=${q}(.+)${q}. + type${s}=${q}(.+)${q}/${s}!U, $match[3], $files, +PREG_SET_ORDER); +$translation[files] = $files; +unset($files); +//print_r($translation); + } print(html head @@ -251,7 +300,15 @@ /td/tr /table /td/tr -/table br +/table br); + +if (isset($translation[intro])) { +print('table width=750 align=centertrtd' . $translation[intro] . +'/td/tr/tablep/p'); +} + +ob_start(); + +print( table width=750 border=0 cellpadding=4 cellspacing=1 align=center tr th rowspan=2 bgcolor=#99Translated file/th @@ -274,34 +331,109 @@ /tr ); - // Check the English directory - check_dir($docdir.en/); +// Check the English directory +check_dir($docdir.en/); - print(/table\npnbsp;/p\n); +print(/table\npnbsp;/p\n); - // Files without revision comment - if (count($miss_tag) 0) { -print(table width=350 border=0 cellpadding=3 cellspacing=1 align=center\n. - trth bgcolor=#99bFiles without Revision-comment:/b/th/tr\n); -foreach($miss_tag as $val) { - print( trtd bgcolor=#DDnbsp; $val/td/tr\n); +// If work-in-progress available (valid translation.xml file in lang) +if (isset($translation[files]))
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaSat Dec 15 09:42:38 2001 EDT Modified files: /phpdoc/scripts revcheck.php Log: Adding credits handling capability, so previous translators (worked on the file before the current maintainer can also be mentioned in the comments) Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.5 phpdoc/scripts/revcheck.php:1.6 --- phpdoc/scripts/revcheck.php:1.5 Sat Dec 15 09:10:20 2001 +++ phpdoc/scripts/revcheck.php Sat Dec 15 09:42:38 2001 @@ -94,7 +94,23 @@ } return ($match); } // get_tag() function end + + // Grab CREDITS tag, the place to store previous credits + function get_credits ($file) { +// Read the first 300 chars, the comment should be at +// the begining of the file +$fp = @fopen($file, r) or die (Unable to read $file.); +$line = fread($fp, 300); +fclose($fp); + +if (preg_match('!--\s*CREDITS:\s*(.+)\s*--'U, + $line, $match)) { + return (explode(,, $match[1])); +} else { + return array(); +} + } // get_credits() end // Checks a file, and gather stats function check_file($file, $file_cnt) @@ -128,11 +144,18 @@ $maint = $t_tag[2]; $en_rev = get_tag($file); +// Make the maintainer a link if (isset($plist[$maint])) { $maintd = 'a href=#maint' . $plist[$maint] . '' . $maint . '/a'; } else { $maintd = $maint; } + +// Get credits comment, and add to array +$credits = get_credits($t_file); +foreach ($credits as $nick) { + $personinfo[trim($nick)][credits]++; +} // Make diff link if the revision is not n/a $t_td = substr($t_file, strlen($docdir)+strlen($lang)+1); @@ -374,9 +397,10 @@ th rowspan=2 bgcolor=#99Contact email/th th rowspan=2 bgcolor=#99Nick/th th rowspan=2 bgcolor=#99CVS/th - th colspan=5 bgcolor=#99Files maintained/th + th colspan=6 bgcolor=#99Files maintained/th /tr tr + th bgcolor=#99credits/th th bgcolor=#99actual/th th bgcolor=#99old/th th bgcolor=#99veryold/th @@ -392,9 +416,9 @@ $pi = $personinfo[$person[3]]; print(tr bgcolor=$coltda name=\maint$num\$person[1]/a/td . td$person[2]/tdtd$person[3]/tdtd$cvsu/td . - td align=center$pi[actual]/tdtd align=center$pi[old]/td . - td align=center$pi[veryold]/tdtd align=center$pi[norev]/td. - td align=center$pi[wip]/td/tr); + td align=center$pi[credits]/tdtd align=center$pi[actual]/td. + td align=center$pi[old]/tdtd align=center$pi[veryold]/td. + td align=center$pi[norev]/tdtd align=center$pi[wip]/td/tr); } print (/table\npnbsp;/p\n);
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
tom Sat Sep 8 08:20:34 2001 EDT Modified files: /phpdoc/scripts revcheck.php Log: Corrected cvs-links, hiding table headers of empty dirs for a better overview Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.2 phpdoc/scripts/revcheck.php:1.3 --- phpdoc/scripts/revcheck.php:1.2 Sat Sep 1 16:23:09 2001 +++ phpdoc/scripts/revcheck.php Sat Sep 8 08:20:34 2001 @@ -97,7 +97,7 @@ // Checks a file, and gather stats - function check_file($file) + function check_file($file, $file_cnt) { // The information is contained in these global arrays and vars global $miss_file, $miss_tag, $lang, $docdir, $fp, $r_alert, @@ -133,7 +133,9 @@ $r_diff = intval($en_rev) - intval($t_tag[1]); $t_rev = 1..$t_tag[1]; if ($r_diff != 0) { -$t_td = a href=\http://cvs.php.net/diff.php/$file?r1=1.$t_tag[1]r2=1.$en_rev$cvs_opt\;$t_td/a; +$t_td = a href=\http://cvs.php.net/diff.php/;. + preg_replace( '^.$docdir.', phpdoc/, $file ). + ?r1=1.$t_tag[1]r2=1.$en_rev$cvs_opt\$t_td/a; } } else { $r_diff = $t_rev = $t_tag[1]; @@ -158,7 +160,11 @@ $col =#eee8aa; } - +// Write out directory headline +if ($file_cnt == 0) { + $display_dir = preg_replace('($docdir)(.+)/[^/]*$', \\2/, $t_file); + fwrite($fp, trth colspan=12 height=3 +bgcolor=#99$display_dir/th/tr); +} // Write out the line for the file into the file fwrite($fp, tr\n td bgcolor=$col$t_td/td\n. @@ -181,10 +187,6 @@ { global $fp, $docdir, $lang; -// Write out directory headline -$display_dir = preg_replace(!$docdir(en)(.+)!, $lang\\2, $dir); -fwrite($fp, trth colspan=12 height=3 bgcolor=#99$display_dir/th/tr); - // Collect files and diretcories in these arrays $directories = array(); $files = array(); @@ -207,13 +209,9 @@ sort($files); // Files first... -$nofile = TRUE; +$file_cnt = 0; foreach ($files as $file) { - if (check_file($dir.$file)) { $nofile = FALSE; } -} -if ($nofile) { - fwrite($fp, trtd colspan=12 height=3 bgcolor=#DD align=centerNo -processable file in this directory, or no such directory/td/tr); + if (check_file($dir.$file, $file_cnt)) { $file_cnt++; } } // than the subdirs
[PHP-DOC] cvs: phpdoc /scripts revcheck.php
gobaSat Sep 1 16:23:10 2001 EDT Modified files: /phpdoc/scripts revcheck.php Log: Status can contain spaces Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.1 phpdoc/scripts/revcheck.php:1.2 --- phpdoc/scripts/revcheck.php:1.1 Thu Aug 30 11:34:55 2001 +++ phpdoc/scripts/revcheck.php Sat Sep 1 16:23:09 2001 @@ -84,13 +84,13 @@ // Checking for the translations revision tag else { preg_match (/!--\s*EN-Revision:\s*\d+\.(\d+)\s*Maintainer:\s*(.$val. -)\s*Status:\s*(\S+)\s*--/, $line, $match); +)\s*Status:\s*(.+)\s*--/, $line, $match); } // The tag with revision number is not found so search // for n/a revision comment if (count($match) == 0) { preg_match ('!--\s*EN-Revision:\s*(n/a)\s*Maintainer:\s*(.$val. -)\s*Status:\s*(\S+)\s*--', $line, $match); +)\s*Status:\s*(.+)\s*--', $line, $match); } return ($match); } // get_tag() function end