cvs: phd(PHD_ENTERPRISE) / render.php /formats xhtml.php /include PhDBuildOptions.class.php PhDFormat.class.php
| From: | Rudy Nappée | Date: | Thu, 31 Jul 2008 21:23:19 +0000 |
| Subject: | cvs: phd(PHD_ENTERPRISE) / render.php /formats xhtml.php /include PhDBuildOptions.class.php PhDFormat.class.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1967@lists.php.net to get a copy of this message | ||
loudi Thu Jul 31 21:23:19 2008 UTC
Modified files: (Branch: PHD_ENTERPRISE)
/phd/formats xhtml.php
/phd/include PhDFormat.class.php PhDBuildOptions.class.php
/phd render.php
Log:
* now supports --index modifier
* TOC is now displayed fine on xhtml
* some fixes related to SQLite3 queries
* added helper functions in PhDFormat
http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.68.2.3&r2=1.68.2.4&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.68.2.3 phd/formats/xhtml.php:1.68.2.4 --- phd/formats/xhtml.php:1.68.2.3 Wed Jul 30 12:17:21 2008 +++ phd/formats/xhtml.php Thu Jul 31 21:23:19 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: xhtml.php,v 1.68.2.3 2008/07/30 12:17:21 loudi Exp $ */ +/* $Id: xhtml.php,v 1.68.2.4 2008/07/31 21:23:19 loudi Exp $ */ class PhDXHTMLFormat extends PhDFormat { private $myelementmap = array( /* {{{ */ 'abstract' => 'div', /* Docbook-xsl prints "abstract"... */ @@ -454,16 +454,14 @@ //var_dump($id, $this->CHILDRENS); //echo "\n\n"; } - $row = $this->getParentInfo($id); - if (isset($row[0])) { - $parent = array("href" => $row[0]["filename"]. '.' .$this->ext, "desc" => $row[0]["ldesc"] ?: $row[0]["sdesc"]); - } + + $parent = $this->getParentInfo($id); /* }}} */ return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' .$lang. '"" lang="' .$lang. '"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' .$lang. '" lang="' .$lang. '"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>PHP: '.$title.'</title> @@ -497,69 +495,53 @@ $retval = null; if (isset($this->idx[$for])) { $rsl = $this->idx[$for]; - $retval = $rsl["filename"] . '.' . $this->ext . '#' . $rsl["docbook_id"]; + $retval = $rsl["filename"] . "." . $this->ext . '#' . $rsl["docbook_id"]; $desc = $rsl["sdesc"] ?: $rsl["ldesc"]; } return $retval; - return NO_SQLITE; if ($desc === null) { $rsl = $this->sqlite->query("SELECT docbook_id, filename FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - if (!isset($rsl[0])) { + if (!is_array($rsl)) { return false; } - $retval = $rsl[0]["filename"] . '.' . $this->ext . '#' . $rsl[0]["docbook_id"]; + $retval = $rsl["filename"] . '.' . $this->ext . '#' . $rsl["docbook_id"]; } else { $rsl = $this->sqlite->query($q = "SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - if (!isset($rsl[0])) { + if (!is_array($rsl)) { var_dump($q); return false; } - $retval = $rsl[0]["filename"] . '.' . $this->ext . '#' . $rsl[0]["docbook_id"]; + $retval = $rsl["filename"] . '.' . $this->ext . '#' . $rsl["docbook_id"]; if ($type === self::SDESC) { - $desc = $rsl[0]["sdesc"] ?: $rsl[0]["ldesc"]; + $desc = $rsl["sdesc"] ?: $rsl["ldesc"]; } else { - $desc = $rsl[0]["ldesc"] ?: $rsl[0]["sdesc"]; + $desc = $rsl["ldesc"] ?: $rsl["sdesc"]; } } return $retval; } - public function getLongDescription($for) { - return NO_SQLITE; - $rsl = $this->sqlite->query($q = "SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - if (!isset($rsl[0])) { - var_dump($q); - return false; - } - return $rsl[0]["ldesc"] ?: $rsl[0]["sdesc"]; - } - public function getShortDescription($for) { - return NO_SQLITE; - $rsl = $this->sqlite->query("SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - return $rsl[0]["sdesc"] ?: $rsl[0]["ldesc"]; - } public function getParentInfo($for) { - return NO_SQLITE; - $rsl = $this->sqlite->query("SELECT parent_id FROM ids WHERE docbook_id='$for'"); - return $this->sqlite->query("SELECT filename, sdesc, ldesc FROM ids WHERE docbook_id='{$rsl[0]["parent_id"]}'")->fetchArray(SQLITE3_ASSOC); + $parentId = $this->getParent($for); + return array("href" => $this->getFilename($parentId), "desc" => $this->getLongDescription($parentId)); } - protected function createTOC($rsl) { + protected function createTOC(SQLite3_result $result) { $toc = '<ol>'; $desc = $title = ""; - foreach($rsl as $row) { + while ($row = $result->fetchArray()) { $link = $this->createLink($row["docbook_id"], $desc); $list = ""; if ($this->cchunk["name"] === "book" || $this->cchunk["name"] === "set") { - $childrens = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='{$row["docbook_id"]}' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); - if (NO_SQLITE && $childrens) { + $childrens = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='{$row["docbook_id"]}' AND filename=docbook_id"); + if ($childrens) { $list = "<ol>"; - foreach($childrens as $child) { + while ($child = $childrens->fetchArray()) { $href = $this->createLink($child["docbook_id"], $title); $list .= '<li><a href="' .$href. '">' .$title. "</a></li>\n"; } @@ -757,9 +739,9 @@ $this->notify(PhDRender::CHUNK, PhDRender::CLOSE); $toc = ""; - if (NO_SQLITE && !in_array($id, $this->TOC_WRITTEN)) { - $rsl = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); - $toc = $this->createTOC($rsl); + if (!NO_SQLITE && !in_array($id, $this->TOC_WRITTEN)) { + $result = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id"); + $toc = $this->createTOC($result); } return $toc."</div>"; } @@ -769,9 +751,9 @@ } $id = $this->CURRENT_CHUNK; - if (NO_SQLITE) { - $this->CHILDRENS = $rsl = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); - $toc = $this->createToc($rsl); + if (!NO_SQLITE) { + $this->CHILDRENS = $result = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id"); + $toc = $this->createTOC($result); } else { $this->CHILDRENS = array(); $toc = ""; @@ -789,7 +771,7 @@ } if ($open) { - if (NO_SQLITE) { + if (!NO_SQLITE) { $this->CHILDRENS = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); } $this->CURRENT_CHUNK = $id; http://cvs.php.net/viewvc.cgi/phd/include/PhDFormat.class.php?r1=1.10.6.4&r2=1.10.6.5&diff_format=u Index: phd/include/PhDFormat.class.php diff -u phd/include/PhDFormat.class.php:1.10.6.4 phd/include/PhDFormat.class.php:1.10.6.5 --- phd/include/PhDFormat.class.php:1.10.6.4 Wed Jul 30 12:27:27 2008 +++ phd/include/PhDFormat.class.php Thu Jul 31 21:23:19 2008 @@ -5,7 +5,7 @@ const LDESC = 2; private $elementmap = array(); - private $textmapmap = array(); + private $textmap = array(); protected $sqlite; private static $autogen = array(); @@ -25,10 +25,9 @@ public function sortIDs() { $this->sqlite->createAggregate("idx", array($this, "SQLiteIndex"), array($this, "SQLiteFinal"), 6); - $this->sqlite->querySingle('SELECT idx(docbook_id, filename, parent_id, sdesc, ldesc, element) FROM ids'); - //print_r($this->idx); + $this->sqlite->query('SELECT idx(docbook_id, filename, parent_id, sdesc, ldesc, element) FROM ids'); } - public function SQLiteIndex(&$context, $id, $filename, $parent, $sdesc, $ldesc, $element) { + public function SQLiteIndex(&$context, $index, $id, $filename, $parent, $sdesc, $ldesc, $element) { $this->idx[$id] = array( "docbook_id" => $id, "filename" => $filename, @@ -111,6 +110,40 @@ return self::autogen($text, $lang); } +/* {{{ TOC helper functions */ + final public function getFilename($id) { + $row = $this->sqlite->query($q = "SELECT filename FROM ids WHERE docbook_id='$id'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["filename"]; + } + final public function getParent($id) { + $row = $this->sqlite->query($q = "SELECT parent_id FROM ids WHERE docbook_id='$id'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["parent_id"]; + } + final public function getLongDescription($for) { + $row = $this->sqlite->query($q = "SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["ldesc"] ?: $row["sdesc"]; + } + final public function getShortDescription($for) { + $row = $this->sqlite->query($q = "SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["sdesc"] ?: $row["ldesc"]; + } +/* }}} */ /* {{{ Table helper functions */ public function tgroup($attrs) { http://cvs.php.net/viewvc.cgi/phd/include/PhDBuildOptions.class.php?r1=1.6.2.2&r2=1.6.2.3&diff_format=u Index: phd/include/PhDBuildOptions.class.php diff -u phd/include/PhDBuildOptions.class.php:1.6.2.2 phd/include/PhDBuildOptions.class.php:1.6.2.3 --- phd/include/PhDBuildOptions.class.php:1.6.2.2 Wed Jul 30 12:17:21 2008 +++ phd/include/PhDBuildOptions.class.php Thu Jul 31 21:23:19 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: PhDBuildOptions.class.php,v 1.6.2.2 2008/07/30 12:17:21 loudi Exp $ */ +/* $Id: PhDBuildOptions.class.php,v 1.6.2.3 2008/07/31 21:23:19 loudi Exp $ */ class PhDBuildOptionsParser extends PhDOptionParser { @@ -52,7 +52,6 @@ } public function option_index($k, $v) { - /* if (is_array($v)) { trigger_error(sprintf("You cannot pass %s more than once", $k), E_USER_ERROR); } @@ -61,7 +60,7 @@ PhDConfig::set_index($val); } else { trigger_error("yes/no || on/off || true/false || 1/0 expected", E_USER_ERROR); - }*/ + } } public function option_d($k, $v) http://cvs.php.net/viewvc.cgi/phd/render.php?r1=1.3.2.5&r2=1.3.2.6&diff_format=u Index: phd/render.php diff -u phd/render.php:1.3.2.5 phd/render.php:1.3.2.6 --- phd/render.php:1.3.2.5 Wed Jul 30 12:27:27 2008 +++ phd/render.php Thu Jul 31 21:23:19 2008 @@ -34,7 +34,7 @@ foreach(range(0, 0) as $i) { //var_dump(date(DATE_RSS)); - if (1) { + if (PhDConfig::index()) { v("Indexing...", VERBOSE_INDEXING); // Create indexer $format = new PhDIndex(); @@ -48,6 +48,8 @@ v("Indexing done", VERBOSE_INDEXING); //var_dump(date(DATE_RSS)); + } else { + v("Skipping indexing", VERBOSE_INDEXING); } foreach (PhDConfig::output_format() as $format) {
http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.68.2.3&r2=1.68.2.4&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.68.2.3 phd/formats/xhtml.php:1.68.2.4 --- phd/formats/xhtml.php:1.68.2.3 Wed Jul 30 12:17:21 2008 +++ phd/formats/xhtml.php Thu Jul 31 21:23:19 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: xhtml.php,v 1.68.2.3 2008/07/30 12:17:21 loudi Exp $ */ +/* $Id: xhtml.php,v 1.68.2.4 2008/07/31 21:23:19 loudi Exp $ */ class PhDXHTMLFormat extends PhDFormat { private $myelementmap = array( /* {{{ */ 'abstract' => 'div', /* Docbook-xsl prints "abstract"... */ @@ -454,16 +454,14 @@ //var_dump($id, $this->CHILDRENS); //echo "\n\n"; } - $row = $this->getParentInfo($id); - if (isset($row[0])) { - $parent = array("href" => $row[0]["filename"]. '.' .$this->ext, "desc" => $row[0]["ldesc"] ?: $row[0]["sdesc"]); - } + + $parent = $this->getParentInfo($id); /* }}} */ return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' .$lang. '"" lang="' .$lang. '"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' .$lang. '" lang="' .$lang. '"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>PHP: '.$title.'</title> @@ -497,69 +495,53 @@ $retval = null; if (isset($this->idx[$for])) { $rsl = $this->idx[$for]; - $retval = $rsl["filename"] . '.' . $this->ext . '#' . $rsl["docbook_id"]; + $retval = $rsl["filename"] . "." . $this->ext . '#' . $rsl["docbook_id"]; $desc = $rsl["sdesc"] ?: $rsl["ldesc"]; } return $retval; - return NO_SQLITE; if ($desc === null) { $rsl = $this->sqlite->query("SELECT docbook_id, filename FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - if (!isset($rsl[0])) { + if (!is_array($rsl)) { return false; } - $retval = $rsl[0]["filename"] . '.' . $this->ext . '#' . $rsl[0]["docbook_id"]; + $retval = $rsl["filename"] . '.' . $this->ext . '#' . $rsl["docbook_id"]; } else { $rsl = $this->sqlite->query($q = "SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - if (!isset($rsl[0])) { + if (!is_array($rsl)) { var_dump($q); return false; } - $retval = $rsl[0]["filename"] . '.' . $this->ext . '#' . $rsl[0]["docbook_id"]; + $retval = $rsl["filename"] . '.' . $this->ext . '#' . $rsl["docbook_id"]; if ($type === self::SDESC) { - $desc = $rsl[0]["sdesc"] ?: $rsl[0]["ldesc"]; + $desc = $rsl["sdesc"] ?: $rsl["ldesc"]; } else { - $desc = $rsl[0]["ldesc"] ?: $rsl[0]["sdesc"]; + $desc = $rsl["ldesc"] ?: $rsl["sdesc"]; } } return $retval; } - public function getLongDescription($for) { - return NO_SQLITE; - $rsl = $this->sqlite->query($q = "SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - if (!isset($rsl[0])) { - var_dump($q); - return false; - } - return $rsl[0]["ldesc"] ?: $rsl[0]["sdesc"]; - } - public function getShortDescription($for) { - return NO_SQLITE; - $rsl = $this->sqlite->query("SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); - return $rsl[0]["sdesc"] ?: $rsl[0]["ldesc"]; - } public function getParentInfo($for) { - return NO_SQLITE; - $rsl = $this->sqlite->query("SELECT parent_id FROM ids WHERE docbook_id='$for'"); - return $this->sqlite->query("SELECT filename, sdesc, ldesc FROM ids WHERE docbook_id='{$rsl[0]["parent_id"]}'")->fetchArray(SQLITE3_ASSOC); + $parentId = $this->getParent($for); + return array("href" => $this->getFilename($parentId), "desc" => $this->getLongDescription($parentId)); } - protected function createTOC($rsl) { + protected function createTOC(SQLite3_result $result) { $toc = '<ol>'; $desc = $title = ""; - foreach($rsl as $row) { + while ($row = $result->fetchArray()) { $link = $this->createLink($row["docbook_id"], $desc); $list = ""; if ($this->cchunk["name"] === "book" || $this->cchunk["name"] === "set") { - $childrens = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='{$row["docbook_id"]}' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); - if (NO_SQLITE && $childrens) { + $childrens = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='{$row["docbook_id"]}' AND filename=docbook_id"); + if ($childrens) { $list = "<ol>"; - foreach($childrens as $child) { + while ($child = $childrens->fetchArray()) { $href = $this->createLink($child["docbook_id"], $title); $list .= '<li><a href="' .$href. '">' .$title. "</a></li>\n"; } @@ -757,9 +739,9 @@ $this->notify(PhDRender::CHUNK, PhDRender::CLOSE); $toc = ""; - if (NO_SQLITE && !in_array($id, $this->TOC_WRITTEN)) { - $rsl = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); - $toc = $this->createTOC($rsl); + if (!NO_SQLITE && !in_array($id, $this->TOC_WRITTEN)) { + $result = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id"); + $toc = $this->createTOC($result); } return $toc."</div>"; } @@ -769,9 +751,9 @@ } $id = $this->CURRENT_CHUNK; - if (NO_SQLITE) { - $this->CHILDRENS = $rsl = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); - $toc = $this->createToc($rsl); + if (!NO_SQLITE) { + $this->CHILDRENS = $result = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id"); + $toc = $this->createTOC($result); } else { $this->CHILDRENS = array(); $toc = ""; @@ -789,7 +771,7 @@ } if ($open) { - if (NO_SQLITE) { + if (!NO_SQLITE) { $this->CHILDRENS = $this->sqlite->query("SELECT docbook_id, filename, sdesc, ldesc FROM ids WHERE parent_id='$id' AND filename=docbook_id")->fetchArray(SQLITE3_ASSOC); } $this->CURRENT_CHUNK = $id; http://cvs.php.net/viewvc.cgi/phd/include/PhDFormat.class.php?r1=1.10.6.4&r2=1.10.6.5&diff_format=u Index: phd/include/PhDFormat.class.php diff -u phd/include/PhDFormat.class.php:1.10.6.4 phd/include/PhDFormat.class.php:1.10.6.5 --- phd/include/PhDFormat.class.php:1.10.6.4 Wed Jul 30 12:27:27 2008 +++ phd/include/PhDFormat.class.php Thu Jul 31 21:23:19 2008 @@ -5,7 +5,7 @@ const LDESC = 2; private $elementmap = array(); - private $textmapmap = array(); + private $textmap = array(); protected $sqlite; private static $autogen = array(); @@ -25,10 +25,9 @@ public function sortIDs() { $this->sqlite->createAggregate("idx", array($this, "SQLiteIndex"), array($this, "SQLiteFinal"), 6); - $this->sqlite->querySingle('SELECT idx(docbook_id, filename, parent_id, sdesc, ldesc, element) FROM ids'); - //print_r($this->idx); + $this->sqlite->query('SELECT idx(docbook_id, filename, parent_id, sdesc, ldesc, element) FROM ids'); } - public function SQLiteIndex(&$context, $id, $filename, $parent, $sdesc, $ldesc, $element) { + public function SQLiteIndex(&$context, $index, $id, $filename, $parent, $sdesc, $ldesc, $element) { $this->idx[$id] = array( "docbook_id" => $id, "filename" => $filename, @@ -111,6 +110,40 @@ return self::autogen($text, $lang); } +/* {{{ TOC helper functions */ + final public function getFilename($id) { + $row = $this->sqlite->query($q = "SELECT filename FROM ids WHERE docbook_id='$id'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["filename"]; + } + final public function getParent($id) { + $row = $this->sqlite->query($q = "SELECT parent_id FROM ids WHERE docbook_id='$id'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["parent_id"]; + } + final public function getLongDescription($for) { + $row = $this->sqlite->query($q = "SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["ldesc"] ?: $row["sdesc"]; + } + final public function getShortDescription($for) { + $row = $this->sqlite->query($q = "SELECT sdesc, ldesc FROM ids WHERE docbook_id='$for'")->fetchArray(SQLITE3_ASSOC); + if (!is_array($row)) { + var_dump($q); + return false; + } + return $row["sdesc"] ?: $row["ldesc"]; + } +/* }}} */ /* {{{ Table helper functions */ public function tgroup($attrs) { http://cvs.php.net/viewvc.cgi/phd/include/PhDBuildOptions.class.php?r1=1.6.2.2&r2=1.6.2.3&diff_format=u Index: phd/include/PhDBuildOptions.class.php diff -u phd/include/PhDBuildOptions.class.php:1.6.2.2 phd/include/PhDBuildOptions.class.php:1.6.2.3 --- phd/include/PhDBuildOptions.class.php:1.6.2.2 Wed Jul 30 12:17:21 2008 +++ phd/include/PhDBuildOptions.class.php Thu Jul 31 21:23:19 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: PhDBuildOptions.class.php,v 1.6.2.2 2008/07/30 12:17:21 loudi Exp $ */ +/* $Id: PhDBuildOptions.class.php,v 1.6.2.3 2008/07/31 21:23:19 loudi Exp $ */ class PhDBuildOptionsParser extends PhDOptionParser { @@ -52,7 +52,6 @@ } public function option_index($k, $v) { - /* if (is_array($v)) { trigger_error(sprintf("You cannot pass %s more than once", $k), E_USER_ERROR); } @@ -61,7 +60,7 @@ PhDConfig::set_index($val); } else { trigger_error("yes/no || on/off || true/false || 1/0 expected", E_USER_ERROR); - }*/ + } } public function option_d($k, $v) http://cvs.php.net/viewvc.cgi/phd/render.php?r1=1.3.2.5&r2=1.3.2.6&diff_format=u Index: phd/render.php diff -u phd/render.php:1.3.2.5 phd/render.php:1.3.2.6 --- phd/render.php:1.3.2.5 Wed Jul 30 12:27:27 2008 +++ phd/render.php Thu Jul 31 21:23:19 2008 @@ -34,7 +34,7 @@ foreach(range(0, 0) as $i) { //var_dump(date(DATE_RSS)); - if (1) { + if (PhDConfig::index()) { v("Indexing...", VERBOSE_INDEXING); // Create indexer $format = new PhDIndex(); @@ -48,6 +48,8 @@ v("Indexing done", VERBOSE_INDEXING); //var_dump(date(DATE_RSS)); + } else { + v("Skipping indexing", VERBOSE_INDEXING); } foreach (PhDConfig::output_format() as $format) {