cvs: peardoc /scripts pearwebbuild.php
| From: | Brett Bieber | Date: | Tue, 18 Nov 2008 20:29:45 +0000 |
| Subject: | cvs: peardoc /scripts pearwebbuild.php | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11286@lists.php.net to get a copy of this message | ||
saltybeagle Tue Nov 18 20:29:45 2008 UTC
Added files:
/peardoc/scripts pearwebbuild.php
Log:
Add script to build the docs for pearweb.
http://cvs.php.net/viewvc.cgi/peardoc/scripts/pearwebbuild.php?view=markup&rev=1.1
Index: peardoc/scripts/pearwebbuild.php
+++ peardoc/scripts/pearwebbuild.php
<?php
/**
* Script to build the documentation for pearweb
*
* This script runs the configure scripts, and generates the bightml, chunked, and pearweb
* files for use in the pearweb project.
* Currently at http://ucommbieber.unl.edu/peardoc/build/,
rsync://ucommbieber.unl.edu/peardoc
*/
$cwd = getcwd();
chdir(dirname(dirname(__FILE__)));
if (isset($_SERVER['argv'], $_SERVER['argv'][1])
&& $_SERVER['argv'][1] == 'updatecvs') {
// Update cvs
shell_exec('cvs -d :pserver:anoncvs@cvs.php.net:/repository checkout peardoc
'.dirname(dirname(__FILE__)));
}
if (isset($_SERVER['argv'], $_SERVER['argv'][2])
&& $_SERVER['argv'][2] == 'updatephd') {
// Update cvs
shell_exec('cvs -d :pserver:anoncvs@cvs.php.net:/repository checkout phd
'.dirname(dirname(dirname(__FILE__)))).'/phd';
shell_exec('pear upgrade -f
'.dirname(dirname(dirname(__FILE__))).'/phd/package.xml');
}
@unlink(dirname(__FILE__).'/build.log');
logAndEcho("Starting Build\n".date('Y-m-d H:i:s'));
foreach (array('de', 'en', 'es', 'fr', 'hu',
'ja', 'nl', 'pl', 'ru') as $lang) {
logAndEcho("Building peardoc/$lang with php configure.php --lang=$lang");
exec("php configure.php --lang=$lang", $output, $return);
if ($return == 0) {
if ($lang == 'en') {
logAndEcho("Building pearweb package tocs");
shell_exec("php scripts/pearwebpackagetocs.php >> scripts/build.log");
}
logAndEcho("Now running phd for $lang");
shell_exec("phd -f xhtml -t pearbightml -o build/$lang -d giant.xml >>
scripts/build.log");
shell_exec("phd -f xhtml -t pearchunkedhtml -o build/$lang -d giant.xml >>
scripts/build.log");
shell_exec("phd -f xhtml -t pearweb -o build/$lang -d giant.xml >>
scripts/build.log");
shell_exec("phd -f xhtml -t pearchm -o build/$lang -d giant.xml >>
scripts/build.log");
logAndEcho("Finished peardoc/$lang");
}
}
logAndEcho("Build complete\n".date('Y-m-d H:i:s'));
function logAndEcho($message, $logfile = 'build.log')
{
echo $message.PHP_EOL;
file_put_contents(dirname(__FILE__).'/'.$logfile, $message.PHP_EOL, FILE_APPEND);
}