cvs: phpdoc / configure.php

From: Date: Thu, 10 Jan 2008 12:35:27 +0000
Subject: cvs: phpdoc / configure.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1018@lists.php.net to get a copy of this message
bjori Thu Jan 10 12:35:27 2008 UTC Modified files: /phpdoc configure.php Log: Errr. Don't bail out on these DTD XInclude errors http://cvs.php.net/viewvc.cgi/phpdoc/configure.php?r1=1.15&r2=1.16&diff_format=u Index: phpdoc/configure.php diff -u phpdoc/configure.php:1.15 phpdoc/configure.php:1.16 --- phpdoc/configure.php:1.15 Thu Jan 10 12:09:47 2008 +++ phpdoc/configure.php Thu Jan 10 12:35:26 2008 @@ -17,10 +17,10 @@ | Authors: Dave Barr <dave@php.net> | +----------------------------------------------------------------------+ - $Id: configure.php,v 1.15 2008/01/10 12:09:47 bjori Exp $ + $Id: configure.php,v 1.16 2008/01/10 12:35:26 bjori Exp $ */ -$cvs_id = '$Id: configure.php,v 1.15 2008/01/10 12:09:47 bjori Exp $'; +$cvs_id = '$Id: configure.php,v 1.16 2008/01/10 12:35:26 bjori Exp $'; $srcdir = "./"; echo "configure.php: $cvs_id\n"; @@ -906,8 +906,21 @@ function print_errors($errors, $die = true) { $errors = libxml_get_errors(); if ($errors) { - array_walk($errors, "xmlerr"); - if ($die) { + $valid = true; + foreach($errors as $err) { + // Skip all XInclude errors + if (!strpos($err->message, "include")) { + $valid = false; + + $file = file($err->file); + $line = rtrim($file[$err->line-1]); + $padding = str_repeat("-", $err->column) . "^"; + + printf("\nERROR (%s:%d)\n%s\n%s\n\t%s\n", $err->file, $err->line, $line, $padding, $err->message); + } + } + + if (!$valid && $die) { echo "eyh man. No worries. Happ shittens. Try again after fixing the errors above\n"; exit(1); } @@ -915,17 +928,6 @@ libxml_clear_errors(); } // }}} -function xmlerr($err) { // {{{ - // Skip all XInclude errors - if (!strpos($err->message, "include")) { - $file = file($err->file); - $line = rtrim($file[$err->line-1]); - $padding = str_repeat("-", $err->column) . "^"; - - printf("\nERROR (%s:%d)\n%s\n%s\n\t%s\n", $err->file, $err->line-1, $line, $padding, $err->message); - } -} // }}} - $dom = new DOMDocument(); $die = $dom->load("manual.xml", LIBXML_DTDVALID|LIBXML_NOENT);

« previous php.doc.cvs (#1018) next »