cvs: peardoc /scripts file-entities.php makemanual.php
| From: | Greg Beaver | Date: | Tue, 02 Nov 2004 07:47:47 +0000 |
| Subject: | cvs: peardoc /scripts file-entities.php makemanual.php | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-5069@lists.php.net to get a copy of this message | ||
cellog Tue Nov 2 02:47:47 2004 EDT
Added files:
/peardoc/scripts makemanual.php
Modified files:
/peardoc/scripts file-entities.php
Log:
script to create manual.xml, version.ent and chapters.ent
first param is language (default en) second is encoding (UTF-8)
C:\> php makemanual.php fr UTF-9
for example (yes I made up UTF-9)
http://cvs.php.net/diff.php/peardoc/scripts/file-entities.php?r1=1.1&r2=1.2&ty=u
Index: peardoc/scripts/file-entities.php
diff -u peardoc/scripts/file-entities.php:1.1 peardoc/scripts/file-entities.php:1.2
--- peardoc/scripts/file-entities.php:1.1 Tue Nov 2 01:48:47 2004
+++ peardoc/scripts/file-entities.php Tue Nov 2 02:47:46 2004
@@ -17,7 +17,7 @@
| Gabor Hojtsy <goba@php.net> |
+----------------------------------------------------------------------+
- $Id: file-entities.php,v 1.1 2004/11/02 06:48:47 cellog Exp $
+ $Id: file-entities.php,v 1.2 2004/11/02 07:47:46 cellog Exp $
*/
/**
@@ -58,7 +58,9 @@
// The translation dir is passed as the 6th argument, counting
// from the end of the argument list
-$trans_dir = "$srcdir/en";
+if (!isset($trans_dir)) {
+ $trans_dir = "$srcdir/en";
+}
// The original directory is in the base directory, and named "en"
$orig_dir = "$srcdir/en";
@@ -88,7 +90,7 @@
fclose($fp);
// Here is the end of the code
-exit;
+return;
// ......:FUNCTION DECLARATIONS:................................................
http://cvs.php.net/co.php/peardoc/scripts/makemanual.php?r=1.1&p=1
Index: peardoc/scripts/makemanual.php
+++ peardoc/scripts/makemanual.php
<?php
echo "making manual.xml...\n";
$date = date('Y-m-d');
$loc = dirname(dirname(__FILE__));
$lang = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 'en';
$encoding = isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] :
'UTF-8';
$manual = file_get_contents("$loc/manual.xml.in", 'r');
$wp = fopen("$loc/manual.xml", 'wb');
$manual = str_replace('@srcdir@', $loc, $manual);
$manual = str_replace('@LANGDIR@', $lang, $manual);
$manual = str_replace('@LANG@', $lang, $manual);
$manual = str_replace('@ENCODING@', $encoding, $manual);
fwrite($wp, $manual, strlen($manual));
fclose($wp);
echo "...done\n";
echo "making version.ent...\n";
$version = file_get_contents("$loc/version.ent.in", 'r');
$wp = fopen("$loc/version.ent", 'wb');
$version = str_replace('@PEAR_BUILD_DATE@', $date, $version);
fwrite($wp, $version, strlen($version));
fclose($wp);
echo "...done";
// make chapters.ent
$trans_dir = "$loc/$lang";
require_once dirname(__FILE__) . '/file-entities.php';
echo "...done";
?>