cvs: phpdoc /scripts check-references.php

From: Date: Fri, 16 Jan 2009 16:33:05 +0000
Subject: cvs: phpdoc /scripts check-references.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3047@lists.php.net to get a copy of this message
vrana Fri Jan 16 16:33:05 2009 UTC Modified files: /phpdoc/scripts check-references.php Log: Extension aliases New type formats http://cvs.php.net/viewvc.cgi/phpdoc/scripts/check-references.php?r1=1.34&r2=1.35&diff_format=u Index: phpdoc/scripts/check-references.php diff -u phpdoc/scripts/check-references.php:1.34 phpdoc/scripts/check-references.php:1.35 --- phpdoc/scripts/check-references.php:1.34 Fri Jan 16 12:04:32 2009 +++ phpdoc/scripts/check-references.php Fri Jan 16 16:33:05 2009 @@ -23,7 +23,7 @@ $scripts_dir = dirname(__FILE__); $phpsrc_dir = realpath("$scripts_dir/../../php-src"); $pecl_dir = realpath("$scripts_dir/../../pecl"); - $zend_dir = realpath("$scripts_dir/../../ZendEngine2"); + $zend_dir = realpath("$phpsrc_dir/ZendEngine2"); $phpdoc_dir = realpath("$scripts_dir/../$lang"); } @@ -39,6 +39,20 @@ $extension = $_SERVER["argv"][2]; +$extension_mapping = array( + "bcmath" => "bc", + "bz2" => "bzip2", + "com_dotnet" => "com", + "date" => "datetime", + "ereg" => "regex", + "gd" => "image", + "interbase" => "ibase", + "odbc" => "uodbc", + "sybase_ct" => "sybase", + "standard" => "{array,classobj,dir,errorfunc,exec,filesystem,funchand,i18n,info,mail,math,misc,network,outcontrol,stream,strings,unicode,url,var}", + "ZendEngine2" => "{array,classobj,errorfunc,funchand,info,misc,strings,var}", +); + // various names for parameters passed by reference // array() means list of parameters, number is position from which all parameters are passed by reference $number_refs = array( @@ -78,6 +92,7 @@ "b" => "bool", "r" => "resource", "a" => "array", + "A" => "array", "o" => "object", "O" => "object", "z" => "mixed", @@ -86,6 +101,7 @@ "u" => "unicode", "C" => "class", "h" => "array", + "H" => "array", "U" => "unicode", "S" => "string", "f" => "callback", @@ -180,7 +196,7 @@ $files = array(); $aliases = array(); // php_function => sources_function $macros = array(); // MACRO => array(body, array(params)) - $largedir = ($dirname == $zend_dir || $dirname == "$phpsrc_dir/ext/standard"); + $largedir = in_array(realpath($dirname), array($zend_dir, realpath("$phpsrc_dir/ext/standard"))); $local_refs = array(); foreach (array_merge((array) glob("$dirname/*.h"), (array) glob("$dirname/*.c*")) as $filename) { $file = file_get_contents($filename); @@ -374,8 +390,9 @@ // compare with documentation $counts = array("refs" => 0, "types" => 0, "arg_counts" => 0, "return" => 0); -$reference_path = "$phpdoc_dir/reference/" . (isset($extension) ? basename($extension) : "*"); -foreach (array_merge(glob("$reference_path/*/*.xml"), glob("$reference_path/*/*/*.xml")) as $filename) { +$extension_dir = (isset($extension) ? basename($extension) : "*"); +$reference_path = "$phpdoc_dir/reference/" . (isset($extension_mapping[$extension_dir]) ? $extension_mapping[$extension_dir] : $extension_dir); +foreach (array_merge(glob("$reference_path/*/*.xml", GLOB_BRACE), glob("$reference_path/*/*/*.xml", GLOB_BRACE)) as $filename) { if (preg_match('~^(.*(?:(\\w+)</classname></ooclass>\\s*)?<methodsynopsis>(.*))<methodname>([^<]+)<(.*)</methodsynopsis>~sU', file_get_contents($filename), $matches)) { $lineno = substr_count($matches[1], "\n") + 1; $return_type = $matches[3];

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