svn: /phd/trunk/phpdotnet/phd/Package/PHP/ XHTML.php

From: Date: Wed, 27 Apr 2011 09:30:09 +0000
Subject: svn: /phd/trunk/phpdotnet/phd/Package/PHP/ XHTML.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-8013@lists.php.net to get a copy of this message
bjori Wed, 27 Apr 2011 09:30:09 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=310547 Log: - Do not error completely out if we can't find these files (makes it possible to generate the install files) - Generate an ID for wacky IDless chunks Changed paths: U phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php Modified: phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php =================================================================== --- phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php 2011-04-27 09:29:10 UTC (rev 310546) +++ phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php 2011-04-27 09:30:09 UTC (rev 310547) @@ -172,9 +172,14 @@ if ($info) { return $info; } + if (!is_file($filename)) { + v("Can't find Version information file (%s), skipping!", $filename, E_USER_WARNING); + return array(); + } + $r = new \XMLReader; if (!$r->open($filename)) { - throw new \Exception("Could not open file for accessing version information: $filename"); + v("Can't open the version info file (%s)", $filename, E_USER_ERROR); } $versions = array(); while($r->read()) { @@ -201,10 +206,16 @@ if ($info) { return $info; } + if (!is_file($filename)) { + v("Can't find acronym file (%s), skipping", $filename, E_USER_WARNING); + return array(); + } + $r = new \XMLReader; if (!$r->open($filename)) { - throw new \Exception("Could not open file for accessing acronym information: $filename"); + v("Could not open file for accessing acronym information (%s)", $filename, E_USER_ERROR); } + $acronyms = array(); while ($r->read()) { if ($r->nodeType != \XMLReader::ELEMENT) { @@ -553,6 +564,11 @@ if (isset($attrs[Reader::XMLNS_XML]["id"])) { $id = $attrs[Reader::XMLNS_XML]["id"]; } + else { + $id = uniqid(); + v("Uhm. Can't find an ID for a chunk? - Generating a random one (%s)", $id, E_USER_WARNING); + } + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id; if (!isset($attrs[Reader::XMLNS_PHD]["chunk"]) || $attrs[Reader::XMLNS_PHD]["chunk"] == "true") { $this->cchunk = $this->dchunk;

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