cvs: peardoc / configure.php
| From: | Christian Weiske | Date: | Wed, 12 Nov 2008 19:50:10 +0000 |
| Subject: | cvs: peardoc / configure.php | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11263@lists.php.net to get a copy of this message | ||
cweiske Wed Nov 12 19:50:10 2008 UTC
Modified files:
/peardoc configure.php
Log:
Add support for example file entities for xincludes
http://cvs.php.net/viewvc.cgi/peardoc/configure.php?r1=1.4&r2=1.5&diff_format=u
Index: peardoc/configure.php
diff -u peardoc/configure.php:1.4 peardoc/configure.php:1.5
--- peardoc/configure.php:1.4 Mon Nov 10 07:38:26 2008
+++ peardoc/configure.php Wed Nov 12 19:50:10 2008
@@ -41,7 +41,7 @@
require_once 'Console/CommandLine.php';
$parser = new Console_CommandLine(array(
'description' => 'configure the pear manual build',
- 'version' => '$Id: configure.php,v 1.4 2008/11/10 07:38:26 cweiske
Exp $'
+ 'version' => '$Id: configure.php,v 1.5 2008/11/12 19:50:10 cweiske
Exp $'
));
$parser->addOption('verbose', array(
@@ -62,7 +62,7 @@
'short_name' => '-h',
'long_name' => '--output',
'action' => 'StoreString',
- 'description' => 'File name or merged (giant) manual',
+ 'description' => 'File name of merged (giant) manual',
'default' => 'giant.xml'
));
$parser->addOption('display_untranslated', array(
@@ -127,14 +127,15 @@
$cwd = getcwd();
chdir('en');
- $arFiles = glob('{,*/,*/*/,*/*/*/,*/*/*/*/,*/*/*/*/*/}*.xml', GLOB_BRACE);
+ $arXmlFiles = glob('{,*/,*/*/,*/*/*/,*/*/*/*/,*/*/*/*/*/}*.xml', GLOB_BRACE);
+ $arPhpFiles = glob('{,*/,*/*/,*/*/*/,*/*/*/*/,*/*/*/*/*/}*.php', GLOB_BRACE);
chdir($cwd);
$hdl = fopen('chapters.ent', 'w');
fputs($hdl, "<!-- DON'T TOUCH - AUTOGENERATED BY configure.php -->\n");
- $nUntranslated = 0;
- foreach ($arFiles as $file) {
+ $nUntranslated = $nUntranslatedPhp = 0;
+ foreach ($arXmlFiles as $file) {
if ($lang != 'en' && !file_exists($lang . '/' . $file)) {
++$nUntranslated;
if ($bDisplayUntranslated) {
@@ -147,13 +148,34 @@
$name = str_replace(array('/', '_'), array('.',
'-'), substr($file, 0, -4));
fputs($hdl, '<!ENTITY ' . $name . ' SYSTEM "' . $entfile .
"\">\n");
}
+ foreach ($arPhpFiles as $file) {
+ if ($lang != 'en' && !file_exists($lang . '/' . $file)) {
+ ++$nUntranslatedPhp;
+ if ($bDisplayUntranslated) {
+ logMsg(' Untranslated example: ' . $lang . '/' . $file);
+ }
+ $entfile = 'en/' . $file;
+ } else {
+ $entfile = $lang . '/' . $file;
+ }
+ $name = str_replace(array('/', '_'), array('.',
'-'), $file);
+ fputs($hdl, '<!ENTITY ' . $name . ' "' . $entfile .
"\">\n");
+ }
+
fclose($hdl);
- logMsg(' ' . count($arFiles) . ' xml files');
+ logMsg(' ' . count($arXmlFiles) . ' xml files');
+ logMsg(' ' . count($arPhpFiles) . ' php examples files');
if ($nUntranslated > 1) {
logMsg(
' ' . $nUntranslated . ' untranslated files'
- . ' (' . number_format(100 / count($arFiles) * $nUntranslated, 2) .
'%)'
+ . ' (' . number_format(100 / count($arXmlFiles) * $nUntranslated, 2) .
'%)'
+ );
+ }
+ if ($nUntranslatedPhp > 1) {
+ logMsg(
+ ' ' . $nUntranslatedPhp . ' untranslated example files'
+ . ' (' . number_format(100 / count($arPhpFiles) * $nUntranslatedPhp, 2) .
'%)'
);
}
logMsg(' done');
@@ -196,7 +218,7 @@
$GLOBALS['errorcode'] = -4;
throw new Exception('Failed to load manual.xml');
}
-
+ $dom->xinclude();
logMsg(' Validating');
if ($bHideErrors) {