For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2004 > Re: [PHP-DOC] cvs: livedocs / livedoc_funcs.php style_mapping.php xml_classes5.php









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DOC] cvs: livedocs / livedoc_funcs.php style_mapping.php xml_classes5.php
Jakub Vrana

2004-05-26, 5:35 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com