Re: Re: [patch] livedocs : Allowing entities in titles
| From: | Mehdi Achour | Date: | Sun, 23 May 2004 23:23:00 +0000 |
| Subject: | Re: Re: [patch] livedocs : Allowing entities in titles | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969360851@lists.php.net to get a copy of this message | ||
Strange, but building from a fresh checkout now gives me this :
http://didou.keliglia.com/php/phpman/index.php?l=en&q=manual
(focus on the Runtime Configuration for example). Does it still
works fine for you ?
Your patch seems to be missing a $this->last_id somewhere, but I can't
test nothing now :(
I also have a patch to exclude some unwanted dockbook ids, like missing-stuff (see BUGS). I implmented it with a $banned_ids array
in the mk_XXX.php files et a if(in_array()) in mktoc.php. Do this
sounds good to you or should I change something ?
I'd like to clear the first bug before commiting $banned_ids (if agreed)
'night
didou
Wez Furlong wrote:
Got it ? I can't be more clear than that :)Perfect ;) How about something like the attached patch instead, that should work with your other case too (untested!).btw, I'm a missing something or is the query executed one more time upon failure line 180 ? Why ?That looks like the only place where ->data gets executed to me. --Wez. ------------------------------------------------------------------------ Index: mkindex.php =================================================================== RCS file: /repository/livedocs/mkindex.php,v retrieving revision 1.33 diff -u -p -r1.33 mkindex.php --- mkindex.php 23 May 2004 08:58:01 -0000 1.33 +++ mkindex.php 23 May 2004 12:50:12 -0000 @@ -59,6 +59,7 @@ class DocBookXMLFileParser { var $last_id = false; var $cdata = null; var $data = ''; + var $id_depth = -1; function DocBookXMLFileParser($filename, $rel, $parser) { $this->fileid = $GLOBALS['fileid']; @@ -89,11 +90,12 @@ class DocBookXMLFileParser { // if there is an ID attribute, record it if (isset($attrs['ID'])) { $this->last_id = $attrs['ID']; + $this->id_depth = 1; } } function end_elem($parser, $name) { - if ($this->last_id !== false) { + if ($this->last_id !== false && --$this->id_depth == 0) { echo "\tAdded ID {$this->last_id}\n"; $this->data .= "INSERT INTO idents VALUES ('" . strtolower($this->last_id) . "', {$this->fileid}, '" . sqlite_escape_string(trim($this->cdata)) . "');"; @@ -107,7 +109,7 @@ class DocBookXMLFileParser { //small hack for '&' $data = str_replace('||amp||', '&', $data); - $this->cdata = $data; + $this->cdata .= trim($data, "\r\n"); } }