cvs: phd /phpdotnet/phd Format.php

From: Date: Thu, 02 Jul 2009 14:13:05 +0000
Subject: cvs: phd /phpdotnet/phd Format.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4312@lists.php.net to get a copy of this message
moacir Thu Jul 2 14:13:05 2009 UTC Modified files: /phd/phpdotnet/phd Format.php Log: now we dont need mktoc http://cvs.php.net/viewvc.cgi/phd/phpdotnet/phd/Format.php?r1=1.4&r2=1.5&diff_format=u Index: phd/phpdotnet/phd/Format.php diff -u phd/phpdotnet/phd/Format.php:1.4 phd/phpdotnet/phd/Format.php:1.5 --- phd/phpdotnet/phd/Format.php:1.4 Mon Jun 22 01:22:52 2009 +++ phd/phpdotnet/phd/Format.php Thu Jul 2 14:13:05 2009 @@ -14,6 +14,10 @@ protected $indexes = array(); protected $childrens = array(); + protected $refs = array(); + protected $vars = array(); + protected $classes = array(); + private static $autogen = array(); /* PhDHelper */ @@ -37,8 +41,14 @@ public function sortIDs() { $this->sqlite->createAggregate("indexes", array($this, "SQLiteIndex"), array($this, "SQLiteFinal"), 8); $this->sqlite->createAggregate("childrens", array($this, "SQLiteChildrens"), array($this, "SQLiteFinal"), 2); + $this->sqlite->createAggregate("refname", array($this, "SQLiteRefname"), array($this, "SQLiteFinal"), 2); + $this->sqlite->createAggregate("varname", array($this, "SQLiteVarname"), array($this, "SQLiteFinal"), 2); + $this->sqlite->createAggregate("classname", array($this, "SQLiteClassname"), array($this, "SQLiteFinal"), 2); $this->sqlite->query('SELECT indexes(docbook_id, filename, parent_id, sdesc, ldesc, element, previous, next) FROM ids'); $this->sqlite->query('SELECT childrens(docbook_id, parent_id) FROM ids'); + $this->sqlite->query('SELECT refname(docbook_id, sdesc) FROM ids WHERE element=\'refentry\''); + $this->sqlite->query('SELECT varname(docbook_id, sdesc) FROM ids WHERE element=\'phpdoc:varentry\''); + $this->sqlite->query('SELECT classname(docbook_id, sdesc) FROM ids WHERE element=\'phpdoc:exceptionref\' OR element=\'phpdoc:classref\''); } public function SQLiteIndex(&$context, $index, $id, $filename, $parent, $sdesc, $ldesc, $element, $previous, $next) { @@ -52,10 +62,6 @@ "previous" => $previous, "next" => $next ); - if ($element == "refentry") { - $this->refs[$sdesc] = $id; - } - } public function SQLiteChildrens(&$context, $index, $id, $parent) { @@ -65,6 +71,19 @@ $this->childrens[$parent][] = $id; } + public function SQLiteRefname(&$context, $index, $id, $sdesc) { + $ref = strtolower(str_replace(array("_", "::", "->"), array("-", "-", "-"), $sdesc)); + $this->refs[$ref] = $id; + } + + public function SQLiteVarname(&$context, $index, $id, $sdesc) { + $this->vars[$sdesc] = $id; + } + + public function SQLiteClassname(&$context, $index, $id, $sdesc) { + $this->classes[strtolower($sdesc)] = $id; + } + public static function SQLiteFinal(&$context) { return $context; } @@ -75,6 +94,16 @@ $format->update($event, $val); } } + + function getRefnameLink($ref) { + return isset($this->refs[$ref]) ? $this->refs[$ref] : null; + } + public function getClassnameLink($class) { + return isset($this->classes[$class]) ? $this->classes[$class] : null; + } + public function getVarnameLink($var) { + return isset($this->vars[$var]) ? $this->vars[$var] : null; + } final public function registerElementMap(array $map) { $this->elementmap = $map; }

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