svn: /phd/trunk/phpdotnet/phd/ Index.php
| From: | Moacir de Oliveira Miranda Júnior | Date: | Fri, 09 Oct 2009 05:10:23 +0000 |
| Subject: | svn: /phd/trunk/phpdotnet/phd/ Index.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5112@lists.php.net to get a copy of this message | ||
moacir Fri, 09 Oct 2009 05:10:23 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=289397
Log:
Fixing bug #49743.
- Removing the primary key of docbook_id
- Allowing multiple sdescs
- Links for functions both oo and procedural working again
Bug: http://bugs.php.net/49743 (Open) Problem with functions
both procedural and oo
Changed paths:
U phd/trunk/phpdotnet/phd/Index.php
Modified: phd/trunk/phpdotnet/phd/Index.php
===================================================================
--- phd/trunk/phpdotnet/phd/Index.php 2009-10-09 05:09:39 UTC (rev 289396)
+++ phd/trunk/phpdotnet/phd/Index.php 2009-10-09 05:10:23 UTC (rev 289397)
@@ -123,7 +123,7 @@
$db = new \SQLite3(Config::output_dir() . 'index.sqlite');
$create = <<<SQL
CREATE TABLE ids (
- docbook_id TEXT PRIMARY KEY,
+ docbook_id TEXT,
filename TEXT,
parent_id TEXT,
sdesc TEXT,
@@ -205,8 +205,6 @@
}
}
public function appendID() {
- static $rand = 0;
-
$lastChunkId = array_pop($this->ids);
$parentid = end($this->ids);
$this->currentid = $parentid;
@@ -231,18 +229,17 @@
$this->db->escapeString($lastChunk["previous"]),
$this->db->escapeString($lastChunk["chunk"])
);
- if ($array === true && !empty($a["sdesc"])) {
+ if ($array === true) {
foreach($lastChunk["sdesc"] as $sdesc) {
- ++$rand;
$this->commit .= sprintf(
- "INSERT INTO ids (docbook_id, filename, parent_id, sdesc, ldesc, element,
previous, next, chunk) VALUES('%s', '%s', '', '%s',
'%s', '%s', '%s', '', %d);\n",
- "phdgen-" . $rand,
+ "INSERT INTO ids (docbook_id, filename, parent_id, sdesc, ldesc, element,
previous, next, chunk) VALUES('%s', '%s', '%s', '%s',
'%s', '%s', '%s', '', 0);\n",
+ $this->db->escapeString($lastChunkId),
$this->db->escapeString($lastChunk["filename"]),
+ $this->db->escapeString($this->currentchunk),
$this->db->escapeString($sdesc),
$this->db->escapeString($lastChunk["ldesc"]),
$this->db->escapeString($lastChunk["element"]),
- $this->db->escapeString($lastChunk["previous"]),
- $this->db->escapeString($lastChunk["chunk"])
+ $this->db->escapeString($lastChunk["previous"])
);
}
}
@@ -308,10 +305,16 @@
}
public function format_sdesc($open, $name, $attrs, $props) {
if ($open) {
+ $s = htmlentities(trim($this->getReader()->readContent()), ENT_COMPAT,
"UTF-8");
if (empty($this->nfo[$this->currentid]["sdesc"])) {
/* FIXME: How can I mark that node with "reparse" flag? */
- $s = htmlentities(trim($this->getReader()->readContent()), ENT_COMPAT,
"UTF-8");
$this->nfo[$this->currentid]["sdesc"] = $s;
+ } else {
+ if (!is_array($this->nfo[$this->currentid]["sdesc"])) {
+ $this->nfo[$this->currentid]["sdesc"] =
(array)$this->nfo[$this->currentid]["sdesc"];
+ }
+ //In the beginning of the array to stay compatible with 0.4
+ array_unshift($this->nfo[$this->currentid]["sdesc"], $s);
}
}
}