cvs: phpdoc / configure.php /scripts file-entities.php.in
| From: | Hannes Magnusson | Date: | Mon, 02 Feb 2009 08:50:23 +0000 |
| Subject: | cvs: phpdoc / configure.php /scripts file-entities.php.in | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3126@lists.php.net to get a copy of this message | ||
bjori Mon Feb 2 08:50:23 2009 UTC
Modified files:
/phpdoc configure.php
/phpdoc/scripts file-entities.php.in
Log:
Fixed bug#47194 (documentation workflow change) (patch by cweiske@)
If a translation has a "broken-files.txt" file, all files mentioned in
that file should be ignored (for that translation) and the english
version of those files be used.
# This makes it possible to commit work-in-progress files for
# translations without breaking the build
http://cvs.php.net/viewvc.cgi/phpdoc/configure.php?r1=1.67&r2=1.68&diff_format=u
Index: phpdoc/configure.php
diff -u phpdoc/configure.php:1.67 phpdoc/configure.php:1.68
--- phpdoc/configure.php:1.67 Fri Jan 9 08:09:27 2009
+++ phpdoc/configure.php Mon Feb 2 08:50:23 2009
@@ -19,11 +19,11 @@
| Gwynne Raskind <gwynne@php.net> |
+----------------------------------------------------------------------+
- $Id: configure.php,v 1.67 2009/01/09 08:09:27 bjori Exp $
+ $Id: configure.php,v 1.68 2009/02/02 08:50:23 bjori Exp $
*/
error_reporting(E_ALL);
-$cvs_id = '$Id: configure.php,v 1.67 2009/01/09 08:09:27 bjori Exp $';
+$cvs_id = '$Id: configure.php,v 1.68 2009/02/02 08:50:23 bjori Exp $';
echo "configure.php: $cvs_id\n";
@@ -56,6 +56,7 @@
--with-php=PATH Path to php CLI executable [detect]
--with-lang=LANG Language to build [{$acd['LANG']}]
--with-partial=ID Root ID to build [{$acd['PARTIAL']}]
+ --disable-broken-file-listing Do not ignore translated files in broken-files.txt
HELPCHUNK;
} // }}}
@@ -250,6 +251,7 @@
'SEGFAULT_ERROR' => 'yes',
'VERSION_FILES' => 'yes',
'HOWTO' => 'no',
+ 'USE_BROKEN_TRANSLATION_FILENAME' => 'yes',
); // }}}
$ac = $acd;
@@ -350,6 +352,9 @@
$ac['HOWTO'] =$v;
break;
+ case 'broken-file-listing':
+ $ac['USE_BROKEN_TRANSLATION_FILENAME'] = $v;
+
default:
echo "WARNING: Unknown option '{$o}'!\n";
break;
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/file-entities.php.in?r1=1.63&r2=1.64&diff_format=u
Index: phpdoc/scripts/file-entities.php.in
diff -u phpdoc/scripts/file-entities.php.in:1.63 phpdoc/scripts/file-entities.php.in:1.64
--- phpdoc/scripts/file-entities.php.in:1.63 Thu Jan 8 17:09:18 2009
+++ phpdoc/scripts/file-entities.php.in Mon Feb 2 08:50:23 2009
@@ -17,7 +17,7 @@
| Gabor Hojtsy <goba@php.net> |
+----------------------------------------------------------------------+
- $Id: file-entities.php.in,v 1.63 2009/01/08 17:09:18 rquadling Exp $
+ $Id: file-entities.php.in,v 1.64 2009/02/02 08:50:23 bjori Exp $
*/
/**
@@ -132,7 +132,19 @@
* @return boolean Success signal
*/
function file_entities($work_dir, $trans_dir, $orig_dir, &$entities, $prefix=false) {
-
+ static $arBroken = null;
+ if ($arBroken === null) {
+ $brokenFilePath = $trans_dir . '/broken-files.txt';
+ if ('@USE_BROKEN_TRANSLATION_FILENAME@' == 'yes' &&
file_exists($brokenFilePath)) {
+ $arBroken = array_map('trim', file($brokenFilePath));
+ for ($n = 0; $n < count($arBroken); $n++) {
+ $arBroken[$n] = $trans_dir . '/' . $arBroken[$n];
+ }
+ $arBroken = array_flip($arBroken);
+ } else {
+ $arBroken = array();
+ }
+ }
// Compute translated version's path
$trans_path = str_replace($orig_dir, $trans_dir, $work_dir);
@@ -190,8 +202,9 @@
}
// If we have a translated file, use it, otherwise fall back to English
- if (file_exists("$trans_path/$file")) {
- $path = "$trans_path/$file";
+ $transfile = "$trans_path/$file";
+ if (!isset($arBroken[$transfile]) && file_exists($transfile)) {
+ $path = $transfile;
} else {
$path = "$work_dir/$file";
}