cvs: peardoc / configure.php
| From: | Christian Weiske | Date: | Mon, 10 Nov 2008 07:38:26 +0000 |
| Subject: | cvs: peardoc / configure.php | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11258@lists.php.net to get a copy of this message | ||
cweiske Mon Nov 10 07:38:26 2008 UTC
Modified files:
/peardoc configure.php
Log:
Set exit code when we're experiencing an error in configure.php
http://cvs.php.net/viewvc.cgi/peardoc/configure.php?r1=1.3&r2=1.4&diff_format=u
Index: peardoc/configure.php
diff -u peardoc/configure.php:1.3 peardoc/configure.php:1.4
--- peardoc/configure.php:1.3 Sat Nov 8 08:01:41 2008
+++ peardoc/configure.php Mon Nov 10 07:38:26 2008
@@ -13,6 +13,7 @@
$opts = parseArgs();
$GLOBALS['display_verbose'] = $opts['verbose'];
+$GLOBALS['errorcode'] = 0;
try {
createVersionEnt('entities/version.ent');
createChaptersEnt($opts['language'], $opts['display_untranslated']);
@@ -25,6 +26,7 @@
} catch (Exception $e) {
logMsg('Exception:');
logMsg($e->getMessage());
+ exit($GLOBALS['errorcode']);
}
@@ -39,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.3 2008/11/08 08:01:41 cweiske
Exp $'
+ 'version' => '$Id: configure.php,v 1.4 2008/11/10 07:38:26 cweiske
Exp $'
));
$parser->addOption('verbose', array(
@@ -93,7 +95,7 @@
return $result->options;
} catch (Exception $exc) {
$parser->displayError($exc->getMessage());
- exit(-1);
+ exit(-2);
}
}
@@ -183,6 +185,7 @@
if ($bHideErrors) {
$msg = ob_get_clean();
if ($msg) {
+ $GLOBALS['errorcode'] = -3;
logMsg(' There were warnings loading the manual');
}
}
@@ -190,6 +193,7 @@
if (isset($msg) && $msg) {
logMsg($msg);
}
+ $GLOBALS['errorcode'] = -4;
throw new Exception('Failed to load manual.xml');
}
@@ -207,6 +211,7 @@
logMsg(' xmllint --valid --noout manual.xml');
logMsg(' xmllint --valid --noout giant.xml');
logMsg(' to get detailled error messages.');
+ $GLOBALS['errorcode'] = -4;
}
$dom->save($strGiant);