Re: cvs: livedocs / livedoc_funcs.php style_mapping.php xml_classes5.php

From: Date: Wed, 26 May 2004 08:18:06 +0000
Subject: Re: cvs: livedocs / livedoc_funcs.php style_mapping.php xml_classes5.php
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969360991@lists.php.net to get a copy of this message
Ilia Alshanetsky wrote: > - switch (count($parts)) { > - case 4: > - $id = 'function.' . $parts[3]; > - $func_name = lookup_title($id); > - break; > - > - case 5: > - if ($parts[3] == 'class') { > - $id = 'class.' . $parts[4]; > - $func_name = str_replace('-', '_', $parts[4]); > - $stag = "xref linkend=\"$id\""; > - $etag = "xref"; > - break; > - } > - /* fall through */ > - > - default: > - /* some weird node type we don't understand */ > - $id = $ref; > - $func_name = 'Unknown ??'; > + if (isset($parts[4]) && $parts[3] == 'class') { > + $id = 'class.' . $parts[4]; > + $func_name = str_replace('-', '_', $parts[4]); > + $stag = "xref linkend=\"$id\""; > + $etag = "xref"; > + } else if (isset($parts[3])) { > + $id = 'function.' . $parts[3]; > + $func_name = lookup_title($id); > + } else { > + /* some weird node type we don't understand */ > + $id = $ref; > + $func_name = 'Unknown ??'; > } This is overtuned, here's the patch. Jakub Vrana

Index: livedoc_funcs.php =================================================================== RCS file: /repository/livedocs/livedoc_funcs.php,v retrieving revision 1.4 diff -u -r1.4 livedoc_funcs.php --- livedoc_funcs.php 25 May 2004 20:15:03 -0000 1.4 +++ livedoc_funcs.php 26 May 2004 08:09:52 -0000 @@ -330,7 +330,7 @@ $func_name = str_replace('-', '_', $parts[4]); $stag = "xref linkend=\"$id\""; $etag = "xref"; - } else if (isset($parts[3])) { + } else if (isset($parts[3]) && !isset($parts[4])) { $id = 'function.' . $parts[3]; $func_name = lookup_title($id); } else {
« previous php.doc (#969360991) next »