Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop until xinclude() gets 0 includes #192

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,20 @@ function getFileModificationHistory(): array {
echo "done.\n";

echo "Running XInclude/XPointer... ";
$status = $dom->xinclude();
$statusCount = 0;
do {
$status = $dom->xinclude();
if ($status !== -1) {
// For some dumb reason when no substitution are made it returns false instead of 0...
$status = (int) $status;
$statusCount += $status;
echo "included $status\n...";
}
} while ($status !== -1 && $status > 0);
if ($status === -1) {
echo "failed.\n";
} else {
/* For some dumb reason when no substitution are made it returns false instead of 0... */
$status = (int) $status;
echo "done. Performed $status XIncludes\n";
echo "done. Performed $statusCount XIncludes\n";
}
flush();

Expand Down
Loading