Skip to content

Commit 31c7149

Browse files
committed
Integrate Jing into configure
1 parent bbd9cfa commit 31c7149

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

configure.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,17 +877,23 @@ function getFileModificationHistory(): array {
877877
exit(0); // Tell the shell that this script finished successfully.
878878
} else {
879879
echo "failed.\n";
880-
echo "\nThe document didn't validate, ";
880+
echo "\nThe document didn't validate\n";
881881

882882
/**
883883
* TODO: Integrate jing to explain schema violations as libxml is *useless*
884884
* And this is not going to change for a while as the maintainer of libxml2 even acknowledges:
885885
* > As it stands, libxml2's Relax NG validator doesn't seem suitable for production.
886886
* cf. https://gitlab.gnome.org/GNOME/libxml2/-/issues/448
887887
*/
888-
echo 'Please use Jing and the:' . PHP_EOL
889-
. 'java -jar ./build/jing.jar /path/to/doc-base/docbook/docbook-v5.2-os/rng/docbookxi.rng /path/to/doc-base/.manual.xml' . PHP_EOL
890-
. 'command to check why the RelaxNG schema failed.' . PHP_EOL;
888+
$output = shell_exec('java -jar ./docbook/jing.jar ./docbook/docbook-v5.2-os/rng/docbookxi.rng .manual.xml');
889+
if ($output === null) {
890+
echo "Command failed do you have Java installed?";
891+
} else {
892+
echo $output;
893+
}
894+
//echo 'Please use Jing and the:' . PHP_EOL
895+
// . 'java -jar ./build/jing.jar /path/to/doc-base/docbook/docbook-v5.2-os/rng/docbookxi.rng /path/to/doc-base/.manual.xml' . PHP_EOL
896+
// . 'command to check why the RelaxNG schema failed.' . PHP_EOL;
891897

892898
// Exit normally when don't care about validation
893899
if ($ac["FORCE_DOM_SAVE"] == "yes") {

0 commit comments

Comments
 (0)