Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions phpdotnet/phd/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ public function getFormatName() {

/* Buffer where append data instead of the standard stream (see format's appendData()) */
final public function parse($xml) {
$parsed = "";
$reader = new Reader();
$render = new Render();

Expand Down Expand Up @@ -509,7 +508,7 @@ public function initRow() {
}
public function getEntryOffset(array $attrs) {
$curr = $this->TABLE["next_colnum"];
foreach($this->TABLE["colspec"] as $col => $spec) {
foreach($this->TABLE["colspec"] as $spec) {
if ($spec["colname"] == $attrs["colname"]) {
$colnum = $spec["colnum"];
$this->TABLE["next_colnum"] += $colnum-$curr;
Expand All @@ -520,7 +519,7 @@ public function getEntryOffset(array $attrs) {
}
public function colspan(array $attrs) {
if (isset($attrs["namest"])) {
foreach($this->TABLE["colspec"] as $colnum => $spec) {
foreach($this->TABLE["colspec"] as $spec) {
if ($spec["colname"] == $attrs["namest"]) {
$from = $spec["colnum"];
continue;
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Format/Abstract/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class PdfWriter {
private $currentFontColor;
private $fonts;
private $oldFonts = array();
private $text;

private $vOffset = 0;
private $hOffset = 0;
Expand Down
2 changes: 0 additions & 2 deletions phpdotnet/phd/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public function highlight($text, $role, $format)
. htmlspecialchars($text, ENT_QUOTES, 'UTF-8')
. "</pre>\n";
}

return $retval;
}//public function highlight(..)

}
Expand Down
4 changes: 2 additions & 2 deletions phpdotnet/phd/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function update($event, $value = null)
}
break;
case Render::FINALIZE:
$retval = $this->db->exec("BEGIN TRANSACTION; INSERT INTO indexing (time) VALUES ('" . time() . "'); COMMIT");
$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);
Expand Down Expand Up @@ -361,7 +361,7 @@ public function format_chunk($open, $name, $attrs, $props) {
return false;
}
if (array_pop($this->isChunk)) {
$lastchunk = array_pop($this->chunks);
array_pop($this->chunks);
$this->currentchunk = end($this->chunks);
$this->appendID();
}
Expand Down
6 changes: 3 additions & 3 deletions phpdotnet/phd/Options/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function option_p($k, $v)
public function option_partial($k, $v)
{
$render_ids = Config::render_ids();
foreach((array)$v as $i => $val) {
foreach((array)$v as $val) {
$recursive = true;
if (strpos($val, "=") !== false) {
list($val, $recursive) = explode("=", $val);
Expand Down Expand Up @@ -215,7 +215,7 @@ public function option_s($k, $v)
public function option_skip($k, $v)
{
$skip_ids = Config::skip_ids();
foreach((array)$v as $i => $val) {
foreach((array)$v as $val) {
$recursive = true;
if (strpos($val, "=") !== false) {
list($val, $recursive) = explode("=", $val);
Expand Down Expand Up @@ -261,7 +261,7 @@ public function option_verbose($k, $v)
{
static $verbose = 0;

foreach((array)$v as $i => $val) {
foreach((array)$v as $val) {
foreach(explode("|", $val) as $const) {
if (defined($const)) {
$verbose |= (int)constant($const);
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Options/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private function checkOptions() {
$checkArgv = explode('=', $argv[$i]);
if (substr($checkArgv[0], 0, 2) == '--') {
if (!in_array(substr($checkArgv[0], 2), $long)) {
trigger_error('Invalid long option ' . $argv[$i] . ' ' . $check, E_USER_ERROR);
trigger_error('Invalid long option ' . $argv[$i], E_USER_ERROR);
}
} elseif (substr($checkArgv[0], 0, 1) == '-') {
if (!in_array(substr($checkArgv[0], 1), $short)) {
Expand Down
9 changes: 1 addition & 8 deletions phpdotnet/phd/Package/Generic/Manpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,7 @@ public function format_refname($open, $name, $attrs, $props) {

return "";
}
/*
public function format_refname($open, $name, $attrs, $props) {
if ($open) {
return "\n.SH " . $this->autogen($name, $props["lang"]) . "\n";
}
return "";
}
*/

public function format_refname_text($value, $tag) {
$this->cchunk["funcname"][] = $this->toValidName(trim($value));

Expand Down
2 changes: 0 additions & 2 deletions phpdotnet/phd/Package/Generic/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,6 @@ public function format_entry($open, $name, $attrs, $props) {
if ($open) {
$dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]);
$align = (isset($dbattrs["align"]) ? $dbattrs["align"] : $align);
$retval = "";
if (isset($dbattrs["colname"])) {
for($i=Format::getEntryOffset($dbattrs); $i>0; --$i) {
$this->pdfDoc->add(PdfWriter::TABLE_ENTRY, array(1, 1, $align));
Expand Down Expand Up @@ -982,7 +981,6 @@ public function format_initializer($open, $name, $attrs) {
public function format_footnoteref($open, $name, $attrs, $props) {
if ($open) {
$linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"];
$found = false;
foreach($this->cchunk["footnote"] as $k => $note) {
if ($note["id"] === $linkend) {
$this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0,0,1));
Expand Down
3 changes: 0 additions & 3 deletions phpdotnet/phd/Package/Generic/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ public function format_suppressed_text($value, $tag) {
}

public function format_link($open, $name, $attrs, $props) {
$link = null;
if ($open) {
$link = $class = $content = "";

Expand Down Expand Up @@ -793,7 +792,6 @@ public function format_container_chunk_below($open, $name, $attrs, $props) {
}

$toc = '<ol>';
$desc = "";
if (!in_array($id, $this->TOC_WRITTEN)) {
$toc = $this->createTOC($id, $name, $props);
}
Expand Down Expand Up @@ -1141,7 +1139,6 @@ public function format_fieldsynopsis_varname($open, $name, $attrs) {
public function format_footnoteref($open, $name, $attrs, $props) {
if ($open) {
$linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"];
$found = false;
foreach($this->cchunk["footnote"] as $k => $note) {
if ($note["id"] === $linkend) {
return '<a href="#fnid' .$note["id"]. '"><sup>[' .($k + 1). ']</sup></a>';
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Package/PEAR/ChunkedXHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public function update($event, $val = null) {
*/
public function header($id) {
$title = $this->getShortDescription($id);
$lang = Config::language();
static $cssLinks = null;
if ($cssLinks === null) {
$cssLinks = $this->createCSSLinks();
Expand Down
5 changes: 1 addition & 4 deletions phpdotnet/phd/Package/PEAR/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,8 @@ public function header($id)
*/
public function footer($id)
{
$ext = $this->ext;
$parent = Format::getParent($id);

return '<?php manualFooter("'
. $this->getFilename($id) . $ext . '", '
. $this->getFilename($id) . $this->ext . '", '
. var_export(Format::getLongDescription($id), true)
. '); ?>';
}
Expand Down
2 changes: 1 addition & 1 deletion phpdotnet/phd/Package/PEAR/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ public function format_phd_pearapi($open, $name, $attrs, $props)
if (count($arLinkend) == 1) {
//link to class
$linktpl = '{$package}/docs/latest/{$package}/{$class}.html';
} else if ($arLinkend[1]{0} == '$') {
} else if ($arLinkend[1][0] == '$') {
//link to class variable
$variable = $arLinkend[1];
$linktpl = '{$package}/docs/latest/{$package}/{$class}.html#var{$variable}';
Expand Down
2 changes: 0 additions & 2 deletions phpdotnet/phd/Package/PHP/ChunkedXHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
namespace phpdotnet\phd;

class Package_PHP_ChunkedXHTML extends Package_PHP_Web {
private $nav = "";

public function __construct() {
parent::__construct();
$this->registerFormatName("PHP-Chunked-XHTML");
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Package/PHP/HowTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function header($id) {
$parent = Format::getParent($id);
$next = $prev = $up = array(null, null);
if ($parent && $parent != "ROOT") {
$siblings = Format::getChildren($parent);
if ($nextId = Format::getNext($id)) {
$next = array(
Format::getFilename($nextId) . $this->getExt(),
Expand Down
1 change: 0 additions & 1 deletion phpdotnet/phd/Package/PHP/KDevelop.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public function format_tocsect1($open, $name, $attrs) {
public function format_tocsect2($open, $name, $attrs) {
if (!isset($attrs[Reader::XMLNS_XML]["id"])) return "";
$id = $attrs[Reader::XMLNS_XML]["id"];
$hasChild = (count(Format::getChildren($id)) > 0);
if ($open) {
$name = htmlspecialchars(Format::getShortDescription($id), ENT_QUOTES, 'UTF-8');
$url = (Format::getFilename($id) ? Format::getFilename($id) : $id) . $this->getExt();
Expand Down
3 changes: 1 addition & 2 deletions phpdotnet/phd/Package/PHP/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected function resolveLinks($name) {
public function format_type_text($type, $tagname) {
$type = trim(preg_replace('/[ \n\t]+/', ' ', $type));
$t = strtolower($type);
$href = $fragment = "";
$href = "";

switch($t) {
case "bool":
Expand Down Expand Up @@ -284,7 +284,6 @@ public function format_type_text($type, $tagname) {
break;
case "mixed":
$href = "language.types.declarations";
$fragment = "language.types.declarations.$t";
break;
default:
/* Check if its a classname. */
Expand Down
1 change: 1 addition & 0 deletions phpdotnet/phd/Package/PHP/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ public static function generateAcronymInfo($filename) {
}

$acronyms = array();
$k = "";
while ($r->read()) {
if ($r->nodeType != \XMLReader::ELEMENT) {
continue;
Expand Down
5 changes: 0 additions & 5 deletions phpdotnet/phd/Reader/Partial.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function read() {
static $currently_skipping = false;
static $arrayPartial = array();
static $arraySkip = array();
$ignore = false;

while($ret = parent::read()) {
$id = $this->getAttributeNs("id", self::XMLNS_XML);
Expand Down Expand Up @@ -83,13 +82,11 @@ public function read() {

unset($this->skip[$id]);
$currently_skipping = false;
$ignore = false;
array_pop($arraySkip);
} else {
v("Skipping %s...", $id, VERBOSE_PARTIAL_READING);

$currently_skipping = $id;
$ignore = true;
$arraySkip[] = $id;
}
} elseif ($currently_skipping && $this->skip[$currently_skipping]) {
Expand All @@ -99,7 +96,6 @@ public function read() {
v("%s done", $id, VERBOSE_PARTIAL_CHILD_READING);
}

$ignore = true;
} elseif ($currently_reading && $this->partial[$currently_reading]) {
if ($currentPartial == $id) {
v("Rendering child of %s, %s", $currently_reading, $id, VERBOSE_PARTIAL_CHILD_READING);
Expand All @@ -120,7 +116,6 @@ public function read() {
parent::next();
}
}
$ignore = true;
}
}
return $ret;
Expand Down