svn: /phd/trunk/ phpdotnet/phd/Index.php phpdotnet/phd/ObjectStorage.php render.php
| From: | Hannes Magnusson | Date: | Tue, 28 Jul 2009 21:35:15 +0000 |
| Subject: | svn: /phd/trunk/ phpdotnet/phd/Index.php phpdotnet/phd/ObjectStorage.php render.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4545@lists.php.net to get a copy of this message | ||
bjori Tue, 28 Jul 2009 21:35:15 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=286471
Log:
- Fix "last indexed" timestamp
- Don't explicitly commit the index, do it when finalizing it
- Don't talk about .manual.xml, just say "Docbook file"
- Simplify attaching formats
- Kill commented out method
Changed paths:
U phd/trunk/phpdotnet/phd/Index.php
U phd/trunk/phpdotnet/phd/ObjectStorage.php
U phd/trunk/render.php
Modified: phd/trunk/phpdotnet/phd/Index.php
===================================================================
--- phd/trunk/phpdotnet/phd/Index.php 2009-07-28 21:25:20 UTC (rev 286470)
+++ phd/trunk/phpdotnet/phd/Index.php 2009-07-28 21:35:15 UTC (rev 286471)
@@ -152,7 +152,11 @@
}
break;
case Render::FINALIZE:
- $this->db->exec("INSERT INTO indexing (time) VALUES ('" .
time() . "')");
+ $retval = $this->db->exec("BEGIN TRANSACTION; INSERT INTO indexing
(time) VALUES ('" . time() . "'); COMMIT");
+ $this->commit();
+ if ($this->db->lastErrorCode()) {
+ trigger_error($this->db->lastErrorMsg(), E_USER_WARNING);
+ }
break;
}
}
@@ -330,14 +334,6 @@
}
}
- /*public function format_refname($open, $name, $attrs, $props) {
- if ($open) {
- $s = $this->getReader()->readInnerXml();
- $s = str_replace(array("_", "::", "->"),
array("-", "-", "-"), $s);
- $this->nfo[$this->currentid]["sdesc"][] = strtolower($s);
- }
- }*/
-
public function commit() {
if (isset($this->commit) && $this->commit) {
var_dump($this->db->exec('BEGIN TRANSACTION; '.$this->commit.'
COMMIT'));
Modified: phd/trunk/phpdotnet/phd/ObjectStorage.php
===================================================================
--- phd/trunk/phpdotnet/phd/ObjectStorage.php 2009-07-28 21:25:20 UTC (rev 286470)
+++ phd/trunk/phpdotnet/phd/ObjectStorage.php 2009-07-28 21:35:15 UTC (rev 286471)
@@ -18,6 +18,7 @@
);
}
parent::attach($obj, $inf);
+ return $obj;
}
final protected static function setReader(Reader $r) {
self::$r[] = $r;
Modified: phd/trunk/render.php
===================================================================
--- phd/trunk/render.php 2009-07-28 21:25:20 UTC (rev 286470)
+++ phd/trunk/render.php 2009-07-28 21:35:15 UTC (rev 286471)
@@ -20,7 +20,7 @@
/* If no docbook file was passed, die */
if (!is_dir(Config::xml_root()) || !is_file(Config::xml_file())) {
- trigger_error("No '.manual.xml' file was given. Specify it on the command line
with --docbook.", E_USER_ERROR);
+ trigger_error("No Docbook file given. Specify it on the command line with
--docbook.", E_USER_ERROR);
}
if (!file_exists(Config::output_dir())) {
v("Creating output directory..", E_USER_NOTICE);
@@ -49,13 +49,11 @@
if (Index::requireIndexing()) {
v("Indexing...", VERBOSE_INDEXING);
// Create indexer
- $format = new Index();
- $render->attach($format);
+ $format = $render->attach(new Index);
$reader->open(Config::xml_file());
$render->render($reader);
- $format->commit();
$render->detach($format);
v("Indexing done", VERBOSE_INDEXING);