cvs: functable / checkdoc dbmodel.sql quickref.dsl table.php

From: Date: Wed, 11 Oct 2000 17:38:30 +0000
Subject: cvs: functable / checkdoc dbmodel.sql quickref.dsl table.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1995@lists.php.net to get a copy of this message
hholzgra Wed Oct 11 10:38:30 2000 EDT Modified files: /functable checkdoc dbmodel.sql quickref.dsl table.php Log: no more php warnings some layout improvements on function detail pages line numbers in documentation xml source links ################################################ WARNING: !!! THE DATABASE FORMAT HAS CHANGED !!! ################################################ add a column 'lineno' of type integer to table docfile using ALTER TABLE docfile ADD lineno INTEGER; or recreate it from scratch by means of dbmodel.sql Index: functable/checkdoc diff -u functable/checkdoc:1.1.1.1 functable/checkdoc:1.2 --- functable/checkdoc:1.1.1.1 Tue Oct 10 10:34:32 2000 +++ functable/checkdoc Wed Oct 11 10:38:30 2000 @@ -3,7 +3,7 @@ # # Script that checks which functions are documented in the manual. # -# $Id: checkdoc,v 1.1.1.1 2000/10/10 17:34:32 hholzgra Exp $ +# $Id: checkdoc,v 1.2 2000/10/11 17:38:30 hholzgra Exp $ # # Author: Stig Bakken <ssb@fast.no> # @@ -22,7 +22,7 @@ } else { foreach $function (sort @functions) { if($func_in_file{lc($function)} ne '') { - printf("insert into docfile(docfile,function) values('%s','%s');\n", $func_in_file{lc($function)},lc($function)); + printf("insert into docfile(docfile,lineno,function) values('%s',%d,'%s');\n", $func_in_file{lc($function)}, $func_in_line{lc($function)},lc($function)); } } @fif = keys %func_in_file; @@ -36,7 +36,7 @@ } foreach $func (sort keys %func_in_file) { next if $in_funclist{lc($func)}; - printf("insert into docfile(docfile,function) values('%s','%s');\n", $func_in_file{lc($func)},lc($func)); + printf("insert into docfile(docfile,lineno,function) values('%s',%d,'%s');\n", $func_in_file{lc($func)}, $func_in_line{lc($func)},lc($func)); } ### Subroutines: @@ -56,15 +56,18 @@ } sub check_functions { - foreach $sgml_file (@_) { - $path = "$dir/$sgml_file"; - if (open(SGML, $path)) { + foreach $sgml_file (@_) { + $path = "$dir/$sgml_file"; + if (open(SGML, $path)) { + $line=0; while (<SGML>) { - next unless (m!(^|\s+)id\s*=\s*(['\"])([^\2]*?)\2\s*!); + $line++; + next unless (m!(^|\s+)id\s*=\s*(['\"])([^\2]*?)\2\s*!); $func = $3; next unless ($func =~ s!^(function|class)\.!!); $func =~ s/-/_/g; $func_in_file{$func} = $sgml_file; + $func_in_line{$func} = $line; } } else { warn "Could not open $path\n"; Index: functable/dbmodel.sql diff -u functable/dbmodel.sql:1.1.1.1 functable/dbmodel.sql:1.2 --- functable/dbmodel.sql:1.1.1.1 Tue Oct 10 10:34:32 2000 +++ functable/dbmodel.sql Wed Oct 11 10:38:30 2000 @@ -12,6 +12,7 @@ CREATE TABLE docfile ( function varchar(100) DEFAULT '' NOT NULL, docfile varchar(100), + lineno integer, key df_idx (function) ); Index: functable/quickref.dsl diff -u functable/quickref.dsl:1.1.1.1 functable/quickref.dsl:1.2 --- functable/quickref.dsl:1.1.1.1 Tue Oct 10 10:34:32 2000 +++ functable/quickref.dsl Wed Oct 11 10:38:30 2000 @@ -4,7 +4,7 @@ <!-- - $Id: quickref.dsl,v 1.1.1.1 2000/10/10 17:34:32 hholzgra Exp $ + $Id: quickref.dsl,v 1.2 2000/10/11 17:38:30 hholzgra Exp $ Stylesheet for extracting a quick reference of all functions. @@ -21,26 +21,29 @@ (define newline "\U-000D") (element refentry (process-children)) + (element refnamediv (process-children)) + (element refname (make sequence (literal "INSERT INTO quickref(function,language,descr) VALUES ('") (literal (data (current-node))) (literal "','@LANG@','"))) + (element refpurpose - (make sequence - (literal (string-replace - (string-replace - (string-replace - (data (current-node)) "&#13;" " " - ) - "'" "`") - "&#9;" " ") - ) - (literal "');") - (literal newline) - ) - ) + (make sequence + (literal (string-replace + (string-replace + (string-replace + (data (current-node)) "&#13;" " " + ) + "'" "`") + "&#9;" " ") + ) + (literal "');") + (literal newline) + ) + ) (element book (process-children)) (element part (process-children)) Index: functable/table.php diff -u functable/table.php:1.2 functable/table.php:1.3 --- functable/table.php:1.2 Wed Oct 11 05:42:06 2000 +++ functable/table.php Wed Oct 11 10:38:30 2000 @@ -182,7 +182,7 @@ case "yes": case false: #$url="../phpdoc/html/function.$docname.html"; - $url="http://www.zend.com/manual/function.$docname.php"; + $url="http://php.net/manual/function.$docname.php"; break; default: $url = "http://php.net/manual/$language/html/function.$docname.html"; @@ -233,7 +233,6 @@ <html> <head> <title><? echo strip_tags($ttitle) ?></title> - <? // $ol->init(); ?> </head> <body bgcolor="<?= $color1?>"> <h1>PHP Function Table / Implementation &amp; Documentation</h1> @@ -395,12 +394,12 @@ mysql_free_result($result); echo "getting function docfiles\n"; -$result = mysql_query("select function,docfile from docfile where docfile is not null"); +$result = mysql_query("select function,docfile,lineno from docfile where docfile is not null"); if(!$result) { echo mysql_error(); exit; } while($row=mysql_fetch_array($result)) { if(""!=trim($row["docfile"])) { - $docfile[strtolower(trim($row["function"]))]=$row["docfile"]; + $docfile[strtolower(trim($row["function"]))]="$row[docfile]#$row[lineno]"; } } mysql_free_result($result); @@ -745,33 +744,52 @@ head(false,false,"Function Details","$what $function"); } - if(isset($quickref['en'][$function])) { - print("{$quickref[en][$function]}\n"); - } print( "<table width=\"100%\">"); // linke spalte # {{{ documentation block + $docname=str_replace("_","-",$function); print( "<tr valign=\"top\"><td>"); // linke spalte - $docname=str_replace("_","-",$function); + printf( "<table>\n"); + + print("<tr bgcolor=\"$color2\"><td><b>Description</b></td><td>"); + if(isset($quickref['en'][$function])) { + print($quickref['en'][$function]."\n"); + } else { + print("none"); + } + + print("<tr bgcolor=\"$color2\"><td><b>Documentation</b></td><td>"); if(isset($docfile[$function])) { - print("is ".docref($function)." in <a href=\"http://bonsai.php.net/cvsblame.cgi?file=phpdoc/en/functions/".$docfile[$function]."&rev=&root=/local/repository\">".$docfile[$function]."</a>.<p>\n"); + print(docref($function)); if(!isset($alias[$function])) $translation["en"]++; + } else { + print("none"); + } + print("</td></tr>\n"); + + print("<tr bgcolor=\"$color2\"><td><b>XML source</b></td><td>"); + if(isset($docfile[$function])) { + list($filename,$lineno)=split("#",$docfile[$function]); + print("<a href=\"http://bonsai.php.net/cvsblame.cgi?file=phpdoc/en/functions/".$filename."&rev=&root=/local/repository#$lineno\">phpdoc/en/function".$filename."</a>"); } else { - print("is not documented yet<p>\n"); + print("none"); } + print("</td></tr>\n"); - print("available translations: "); + print("<tr bgcolor=\"$color2\"><td><b>Translations</b></td><td>"); reset($translation); while(list($language,)=each($translation)) { if($language=='en') continue; if(isset($doc[$language][strtolower(trim($function))])) print(" ".docref($function,$language)); } + print("</td></tr>\n"); + printf("</table>\n"); print( "\n</td><td>\n"); // rechte spalte if(isset($proto4[$function])) { @@ -791,24 +809,31 @@ # {{{ php 4 block print( "<tr valign=top><td>"); // linke spalte + printf("<table>"); if(isset($alias[$function])) { - print("this is an alias for function ".fpage($alias[$function])."<p>\n"); + print("<tr bgcolor=\"$color2\"><td><b>this is an alias for function</b></td><td>"); + print(fpage($alias[$function])); + print("</td></tr>\n"); } - if(isset($file4[$function])) { - print("in the current (CVS) version of PHP 4, this $what is defined in "); - print(sourceref($file4[$function])); - if(isset($imp4[$function])) { - print("<br>and implemented in "); - print(sourceref($imp4[$function])); - } - print("<p>\n"); + print("<tr bgcolor=\"$color2\"><td><b>PHP 4 source definition</b></td><td>"); + if(isset($file4[$function])) { + print(sourceref($file4[$function])); } else { - print("this $what is not available in the current (CVS) version of PHP 4<p>\n"); - } - + printf("none"); + } + print("</td></tr>\n"); - print( "\n</td><td>\n"); // rechte spalte + print("<tr bgcolor=\"$color2\"><td><b>PHP 4 source implementation</b></td><td>"); + if(isset($imp4[$function])) { + print(sourceref($imp4[$function])); + } else { + printf("none"); + } + print("</td></tr>\n"); + print("</table>\n"); + + print( "\n</td><td>\n"); // rechte spalte print("<table>\n"); @@ -844,12 +869,15 @@ print( "<tr valign=top><td>"); // linke spalte + printf("<table><tr bgcolor=\"$color2\"><td>"); + print( "<b>PHP 3 source definition</b>"); + print( "</td><td>"); if(isset($file3[$function])) { - print("in the current (CVS) version of PHP 3, this $what<br>is definend in "); - print(sourceref($file3[$function])."<p>\n"); + print(sourceref($file3[$function])); } else { - print("this $what is not available in the current (CVS) version of PHP 3<p>\n"); + print("none in current CVS</td>"); } + printf("</tr></td></table>\n"); print( "\n</td><td>\n"); // rechte spalte @@ -975,14 +1003,15 @@ head(false,false,"Statistics","Functions implemented but not made available"); print( "<table><tr bgcolor=\"$bgcolor\"><th>function</th><th>file</th></tr>\n"); -$result=mysql_query("select i.function as function, i.file as file " +$result=mysql_query("select i.function as function, i.file as file , i.lineno as lineno" ." from funcimp i left outer join funclist f on f.function=i.function and f.versionid = i.versionid " ." where i.versionid = 499 and f.versionid is null" ." order by file,function"); $count['notpub']=mysql_num_rows($result); while($row=mysql_fetch_array($result)) { bg_toggle(); - print("<tr bgcolor=\"$bgcolor\"><td>".fpage($row["function"])."</td><td>".sourceref($row["file"])."</td></tr>\n"); + $filename = str_replace("php_4_cvs","php4",$row["file"]); + print("<tr bgcolor=\"$bgcolor\"><td>".fpage($row["function"])."</td><td>".sourceref($filename."#".$row["lineno"])."</td></tr>\n"); } mysql_free_result($result); print( "</table>\n"); @@ -1185,12 +1214,20 @@ What's new: - <ul> + <ul> + <li> 11.10.2000 + <ul> + <li> the source to generate theese pages is now available<br> + on <a href="http:cvs.php.net">cvs.php.net</a> + as module <a href="http://cvs.php.net/viewcvs.cgi/functable/">functable</a> + <li> i slightly reformated the function detail page and added line number + information to the XML source links + </ul> <li> 22.8.2000 <ul> <li> improved output for HTML compatibility <li> language identifiers may now have more than two characters - <li> + </ul> <li> 14.8.2000 <ul> <li> statistics imporovements

« previous php.cvs (#1995) next »