cvs: peardoc / check-validity.php
[email protected] ("Christian Weiske")
| Newsgroups | php.pear.doc |
|---|---|
| Message-ID | <cvscweiske1192130574@cvsserver> |
cweiske Thu Oct 11 19:22:54 2007 UTC
Added files:
/peardoc check-validity.php
Log:
Adding small tool to check manual.xml XML validity before commit
http://cvs.php.net/viewvc.cgi/peardoc/check-validity.php?view=markup&rev=1.1
Index: peardoc/check-validity.php
+++ peardoc/check-validity.php
<?php
/**
* Checks if the manual.xml file is valid xml.
* Loads the manual.xml file via PHP's DOM functions.
* If that succeeds, the manual is fine and changes can be commmited.
*
* @author Christian Weiske <[email protected]>
*/
$strManualPath = dirname(__FILE__) . '/manual.xml';
if (!file_exists($strManualPath)) {
echo "manual xml does not exist. Run configure.\n";
exit(2);
}
chdir(dirname($strManualPath));
$doc = new DOMDocument();
$doc->resolveExternals = true;
$doc->substituteEntities = true;
if ($doc->load($strManualPath)) {
echo "All fine.\n";
} else {
echo "Error loading manual xml. Probably broken.\n";
exit(1);
}
?>