cvs: phpdoc /scripts/docgen docgen.php function.tpl mapping.tpl method.tpl
| From: | Felipe Pena | Date: | Sun, 26 Apr 2009 16:26:48 +0000 |
| Subject: | cvs: phpdoc /scripts/docgen docgen.php function.tpl mapping.tpl method.tpl | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3884@lists.php.net to get a copy of this message | ||
felipe Sun Apr 26 16:26:48 2009 UTC
Added files:
/phpdoc/scripts/docgen mapping.tpl
Modified files:
/phpdoc/scripts/docgen docgen.php function.tpl method.tpl
Log:
- Added support to creation of an unique XML to OO and procedural style
based on patterns of its names.
e.g.
DateTime::sub() -> date_sub
DateTime::setTimestamp() -> date_timestamp_set
XMLWriter::writeDtdElement() -> xmlwriter_write_dtd_element
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/docgen.php?r1=1.28&r2=1.29&diff_format=u Index: phpdoc/scripts/docgen/docgen.php diff -u phpdoc/scripts/docgen/docgen.php:1.28 phpdoc/scripts/docgen/docgen.php:1.29 --- phpdoc/scripts/docgen/docgen.php:1.28 Tue Mar 24 00:05:12 2009 +++ phpdoc/scripts/docgen/docgen.php Sun Apr 26 16:26:48 2009 @@ -16,7 +16,7 @@ | Authors: Felipe Pena <felipe@php.net> | +----------------------------------------------------------------------+ - $Id: docgen.php,v 1.28 2009/03/24 00:05:12 philip Exp $ + $Id: docgen.php,v 1.29 2009/04/26 16:26:48 felipe Exp $ */ if (!(extension_loaded('reflection') && extension_loaded('pcre'))) { @@ -85,6 +85,44 @@ } /* }}} */ +function find_function($ext, ReflectionMethod $method = NULL, ReflectionFunction $func = NULL) { /* {{{ */ + $ext_name = strtolower($ext); + $ext = new ReflectionExtension($ext); + + if ($method) { + preg_match_all('/[A-Z][a-z]+|[a-z]+/', $method->name, $parts); + + $possibleNames = array( + $ext_name .'_'. strtolower(implode('_', $parts[0])), + $ext_name .'_'. strtolower(implode('_', array_reverse($parts[0]))) + ); + + foreach ($ext->getFunctions() as $function) { + if (in_array($function->name, $possibleNames)) { + return $function; + } + } + } else { + $func_name = preg_replace('/^'. $ext_name .'_/', '', $func->name); + preg_match_all('/[a-z]+/', $func_name, $parts); + + $possibleNames = array( + strtolower(implode($parts[0])), + strtolower(implode(array_reverse($parts[0]))) + ); + + foreach ($ext->getClasses() as $class) { + foreach ($class->getMethods() as $method) { + if (in_array(strtolower($method->name), $possibleNames)) { + return $method; + } + } + } + } + return false; +} +/* }}} */ + function add_warning($err_msg) { /* {{{ */ global $WARNING, $INFO; @@ -218,19 +256,20 @@ $content = preg_replace('/\{EXT_NAME\}/', ucwords($INFO['actual_extension']), $content); /* {EMPTY_REVISION_KEYWORD} */ - $content = str_replace('{EMPTY_REVISION_KEYWORD}', '<!-- $Revision: 1.28 $ -->', $content); + $content = str_replace('{EMPTY_REVISION_KEYWORD}', '<!-- $Revision: 1.29 $ -->', $content); return $content; } /* }}} */ function create_markup_to_parameter_section(Reflector $obj, $content) { /* {{{ */ + $param_name = ($obj instanceof ReflectionMethod ? 'METHOD' : 'FUNCTION'). '_PARAMETERS'; /* {PARAMETERS} */ if ($obj->getNumberOfParameters()) { - $ident = get_ident_size('PARAMETERS', $content); + $ident = get_ident_size($param_name, $content); $parameters = $obj->getParameters(); - $content = preg_replace('/\{PARAMETERS\}/', create_markup_to_params($parameters, $ident), $content); + $content = preg_replace('/\{'. $param_name .'\}/', create_markup_to_params($parameters, $ident), $content); /* {PARAMETERS_DESCRIPTION} */ if ($ident = get_ident_size('PARAMETERS_DESCRIPTION', $content)) { @@ -256,7 +295,7 @@ $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', $markup, $content, 1); } } else { - $content = preg_replace('/\{PARAMETERS\}/', '<void />', $content, 1); + $content = preg_replace('/\{'. $param_name .'\}/', '<void />', $content, 1); $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', '&no.function.parameters;', $content, 1); } @@ -271,7 +310,7 @@ /* {FUNCTION_NAME} */ $content = preg_replace('/\{FUNCTION_NAME\}/', $function->getName(), $content); - /* {PARAMETERS}, {PARAMETERS_DESCRIPTION} */ + /* {FUNCTION_PARAMETERS}, {PARAMETERS_DESCRIPTION} */ $content = create_markup_to_parameter_section($function, $content); return $content; @@ -279,7 +318,7 @@ /* }}} */ function gen_method_markup(ReflectionMethod $method, $content) { /* {{{ */ - /* {PARAMETER}, {PARAMETERS_DESCRIPTION} */ + /* {METHOD_PARAMETERS}, {PARAMETERS_DESCRIPTION} */ $content = create_markup_to_parameter_section($method, $content); /* {CLASS_NAME_ID} */ @@ -308,6 +347,67 @@ } /* }}} */ +function gen_mapping_markup(ReflectionMethod $method, ReflectionFunction $function, $content) { /* {{{ */ + if ($method->getNumberOfParameters() || $function->getNumberOfParameters()) { + /* {PARAMETERS_DESCRIPTION} */ + if ($ident = get_ident_size('PARAMETERS_DESCRIPTION', $content)) { + $count = 1; + + $func_params = array(); + $method_params = array(); + foreach ($function->getParameters() as $param) { + $func_params[] = $param->getName(); + } + foreach ($method->getParameters() as $param) { + $method_params[] = $param->getName(); + } + + $markup = "<para>\n"; + $markup .= str_repeat(' ', $ident + 1) ."<variablelist>\n"; + foreach ($func_params as $param) { + $markup .= str_repeat(' ', $ident + 2) ."<varlistentry>\n"; + $markup .= str_repeat(' ', $ident + 3) .'<term><parameter>'. ($param ? $param : 'param'. $count) ."</parameter></term>\n"; + $markup .= str_repeat(' ', $ident + 3) ."<listitem>\n"; + $markup .= str_repeat(' ', $ident + 4) ."<para>\n"; + $markup .= str_repeat(' ', $ident + 5) ."Description...\n"; + $markup .= str_repeat(' ', $ident + 4) ."</para>\n"; + $markup .= str_repeat(' ', $ident + 3) ."</listitem>\n"; + $markup .= str_repeat(' ', $ident + 2) ."</varlistentry>\n"; + $count++; + } + $diff_params = array_diff($method_params, $func_params); + + foreach ($method_params as $param) { + if (!($param && in_array($param, $diff_params))) { + continue; + } + $markup .= str_repeat(' ', $ident + 2) ."<varlistentry>\n"; + $markup .= str_repeat(' ', $ident + 3) .'<term><parameter>'. ($param ? $param : 'param'. $count) ."</parameter></term>\n"; + $markup .= str_repeat(' ', $ident + 3) ."<listitem>\n"; + $markup .= str_repeat(' ', $ident + 4) ."<para>\n"; + $markup .= str_repeat(' ', $ident + 5) ."Description...\n"; + $markup .= str_repeat(' ', $ident + 4) ."</para>\n"; + $markup .= str_repeat(' ', $ident + 3) ."</listitem>\n"; + $markup .= str_repeat(' ', $ident + 2) ."</varlistentry>\n"; + $count++; + } + $markup .= str_repeat(' ', $ident + 1) ."</variablelist>\n"; + $markup .= str_repeat(' ', $ident) ."</para>"; + + $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', $markup, $content, 1); + } + } else { + $content = preg_replace('/\{PARAMETERS\}/', '<void />', $content, 1); + $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', '&no.function.parameters;', $content, 1); + } + + $content = gen_method_markup($method, $content); + $content = gen_function_markup($function, $content); + + return $content; +} +/* }}} */ + function gen_class_markup(ReflectionClass $class, $content) { /* {{{ */ $id = format_id($class->getName()); @@ -640,9 +740,16 @@ create_dir($path); $INFO['actual_file'] = $filename; - $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); - $content = gen_method_markup($obj, $content); - + $INFO['mappeds'][] = $filename; + + /* Mappeds */ + if ($function = find_function($INFO['actual_extension'], $obj, NULL)) { + $content = file_get_contents(dirname(__FILE__) .'/mapping.tpl'); + $content = gen_mapping_markup($obj, $function, $content); + } else { + $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); + $content = gen_method_markup($obj, $content); + } save_file($filename, global_check($content)); break; @@ -666,15 +773,29 @@ break; case DOC_FUNCTION: - $path = $OPTION['output'] .'/functions'; - $filename = $path .'/'. format_filename($obj->getName()) .'.xml'; - $INFO['actual_file'] = $filename; - - create_dir($path); - - $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); - $content = gen_function_markup($obj, $content); - + if ($method = find_function($INFO['actual_extension'], NULL, $obj)) { + $path = $OPTION['output'] .'/'. strtolower($method->class); + $filename = $path .'/'. format_filename($method->name) .'.xml'; + + if (in_array($filename, $INFO['mappeds'])) { + return; + } + + create_dir($path); + $INFO['actual_file'] = $filename; + + $content = file_get_contents(dirname(__FILE__) .'/mapping.tpl'); + $content = gen_mapping_markup($method, $obj, $content); + } else { + $path = $OPTION['output'] .'/functions'; + $filename = $path .'/'. format_filename($obj->getName()) .'.xml'; + + create_dir($path); + $INFO['actual_file'] = $filename; + + $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); + $content = gen_function_markup($obj, $content); + } save_file($filename, global_check($content)); break; } @@ -768,7 +889,7 @@ /* }}} */ $OPTION = array(); -$INFO = array('actual_extension' => false); +$INFO = array('actual_extension' => false, 'mappeds' => array()); $WARNING = array(); $OPTION['extension'] = NULL; $OPTION['method'] = NULL; @@ -804,7 +925,7 @@ switch ($opt) { case 'v': case 'version': - printf("%s\n", '$Revision: 1.28 $'); + printf("%s\n", '$Revision: 1.29 $'); break; case 'V': case 'verbose': http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/function.tpl?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/scripts/docgen/function.tpl diff -u phpdoc/scripts/docgen/function.tpl:1.8 phpdoc/scripts/docgen/function.tpl:1.9 --- phpdoc/scripts/docgen/function.tpl:1.8 Tue Mar 24 00:05:12 2009 +++ phpdoc/scripts/docgen/function.tpl Sun Apr 26 16:26:48 2009 @@ -11,7 +11,7 @@ &reftitle.description; <methodsynopsis> <type>ReturnType</type><methodname>{FUNCTION_NAME}</methodname> - {PARAMETERS} + {FUNCTION_PARAMETERS} </methodsynopsis> <para> The function description goes here. http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/method.tpl?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/scripts/docgen/method.tpl diff -u phpdoc/scripts/docgen/method.tpl:1.5 phpdoc/scripts/docgen/method.tpl:1.6 --- phpdoc/scripts/docgen/method.tpl:1.5 Tue Mar 31 04:35:53 2009 +++ phpdoc/scripts/docgen/method.tpl Sun Apr 26 16:26:48 2009 @@ -11,7 +11,7 @@ &reftitle.description; <methodsynopsis> {MODIFIERS}{RETURN_TYPE}<methodname>{FULL_METHOD_NAME}</methodname> - {PARAMETERS} + {METHOD_PARAMETERS} </methodsynopsis> <para> The method description goes here. http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/mapping.tpl?view=markup&rev=1.1 Index: phpdoc/scripts/docgen/mapping.tpl +++ phpdoc/scripts/docgen/mapping.tpl <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="{CLASS_NAME_ID}.{METHOD_NAME_ID}" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>{FULL_METHOD_NAME}</refname> <refname>{FUNCTION_NAME}</refname> <refpurpose>The {METHOD_NAME} purpose</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Object oriented style (method):</para> <methodsynopsis> {MODIFIERS}{RETURN_TYPE}<methodname>{FULL_METHOD_NAME}</methodname> {METHOD_PARAMETERS} </methodsynopsis> <para>Procedural style:</para> <methodsynopsis> <type>ReturnType</type><methodname>{FUNCTION_NAME}</methodname> {FUNCTION_PARAMETERS} </methodsynopsis> <para> Description here. </para> &warn.undocumented.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; {PARAMETERS_DESCRIPTION} </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Description... </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php /* ... */ ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[.... ]]> </screen> </example> </para> <para> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* ... */ ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[.... ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><methodname>Classname::Method</methodname></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/docgen.php?r1=1.28&r2=1.29&diff_format=u Index: phpdoc/scripts/docgen/docgen.php diff -u phpdoc/scripts/docgen/docgen.php:1.28 phpdoc/scripts/docgen/docgen.php:1.29 --- phpdoc/scripts/docgen/docgen.php:1.28 Tue Mar 24 00:05:12 2009 +++ phpdoc/scripts/docgen/docgen.php Sun Apr 26 16:26:48 2009 @@ -16,7 +16,7 @@ | Authors: Felipe Pena <felipe@php.net> | +----------------------------------------------------------------------+ - $Id: docgen.php,v 1.28 2009/03/24 00:05:12 philip Exp $ + $Id: docgen.php,v 1.29 2009/04/26 16:26:48 felipe Exp $ */ if (!(extension_loaded('reflection') && extension_loaded('pcre'))) { @@ -85,6 +85,44 @@ } /* }}} */ +function find_function($ext, ReflectionMethod $method = NULL, ReflectionFunction $func = NULL) { /* {{{ */ + $ext_name = strtolower($ext); + $ext = new ReflectionExtension($ext); + + if ($method) { + preg_match_all('/[A-Z][a-z]+|[a-z]+/', $method->name, $parts); + + $possibleNames = array( + $ext_name .'_'. strtolower(implode('_', $parts[0])), + $ext_name .'_'. strtolower(implode('_', array_reverse($parts[0]))) + ); + + foreach ($ext->getFunctions() as $function) { + if (in_array($function->name, $possibleNames)) { + return $function; + } + } + } else { + $func_name = preg_replace('/^'. $ext_name .'_/', '', $func->name); + preg_match_all('/[a-z]+/', $func_name, $parts); + + $possibleNames = array( + strtolower(implode($parts[0])), + strtolower(implode(array_reverse($parts[0]))) + ); + + foreach ($ext->getClasses() as $class) { + foreach ($class->getMethods() as $method) { + if (in_array(strtolower($method->name), $possibleNames)) { + return $method; + } + } + } + } + return false; +} +/* }}} */ + function add_warning($err_msg) { /* {{{ */ global $WARNING, $INFO; @@ -218,19 +256,20 @@ $content = preg_replace('/\{EXT_NAME\}/', ucwords($INFO['actual_extension']), $content); /* {EMPTY_REVISION_KEYWORD} */ - $content = str_replace('{EMPTY_REVISION_KEYWORD}', '<!-- $Revision: 1.28 $ -->', $content); + $content = str_replace('{EMPTY_REVISION_KEYWORD}', '<!-- $Revision: 1.29 $ -->', $content); return $content; } /* }}} */ function create_markup_to_parameter_section(Reflector $obj, $content) { /* {{{ */ + $param_name = ($obj instanceof ReflectionMethod ? 'METHOD' : 'FUNCTION'). '_PARAMETERS'; /* {PARAMETERS} */ if ($obj->getNumberOfParameters()) { - $ident = get_ident_size('PARAMETERS', $content); + $ident = get_ident_size($param_name, $content); $parameters = $obj->getParameters(); - $content = preg_replace('/\{PARAMETERS\}/', create_markup_to_params($parameters, $ident), $content); + $content = preg_replace('/\{'. $param_name .'\}/', create_markup_to_params($parameters, $ident), $content); /* {PARAMETERS_DESCRIPTION} */ if ($ident = get_ident_size('PARAMETERS_DESCRIPTION', $content)) { @@ -256,7 +295,7 @@ $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', $markup, $content, 1); } } else { - $content = preg_replace('/\{PARAMETERS\}/', '<void />', $content, 1); + $content = preg_replace('/\{'. $param_name .'\}/', '<void />', $content, 1); $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', '&no.function.parameters;', $content, 1); } @@ -271,7 +310,7 @@ /* {FUNCTION_NAME} */ $content = preg_replace('/\{FUNCTION_NAME\}/', $function->getName(), $content); - /* {PARAMETERS}, {PARAMETERS_DESCRIPTION} */ + /* {FUNCTION_PARAMETERS}, {PARAMETERS_DESCRIPTION} */ $content = create_markup_to_parameter_section($function, $content); return $content; @@ -279,7 +318,7 @@ /* }}} */ function gen_method_markup(ReflectionMethod $method, $content) { /* {{{ */ - /* {PARAMETER}, {PARAMETERS_DESCRIPTION} */ + /* {METHOD_PARAMETERS}, {PARAMETERS_DESCRIPTION} */ $content = create_markup_to_parameter_section($method, $content); /* {CLASS_NAME_ID} */ @@ -308,6 +347,67 @@ } /* }}} */ +function gen_mapping_markup(ReflectionMethod $method, ReflectionFunction $function, $content) { /* {{{ */ + if ($method->getNumberOfParameters() || $function->getNumberOfParameters()) { + /* {PARAMETERS_DESCRIPTION} */ + if ($ident = get_ident_size('PARAMETERS_DESCRIPTION', $content)) { + $count = 1; + + $func_params = array(); + $method_params = array(); + foreach ($function->getParameters() as $param) { + $func_params[] = $param->getName(); + } + foreach ($method->getParameters() as $param) { + $method_params[] = $param->getName(); + } + + $markup = "<para>\n"; + $markup .= str_repeat(' ', $ident + 1) ."<variablelist>\n"; + foreach ($func_params as $param) { + $markup .= str_repeat(' ', $ident + 2) ."<varlistentry>\n"; + $markup .= str_repeat(' ', $ident + 3) .'<term><parameter>'. ($param ? $param : 'param'. $count) ."</parameter></term>\n"; + $markup .= str_repeat(' ', $ident + 3) ."<listitem>\n"; + $markup .= str_repeat(' ', $ident + 4) ."<para>\n"; + $markup .= str_repeat(' ', $ident + 5) ."Description...\n"; + $markup .= str_repeat(' ', $ident + 4) ."</para>\n"; + $markup .= str_repeat(' ', $ident + 3) ."</listitem>\n"; + $markup .= str_repeat(' ', $ident + 2) ."</varlistentry>\n"; + $count++; + } + $diff_params = array_diff($method_params, $func_params); + + foreach ($method_params as $param) { + if (!($param && in_array($param, $diff_params))) { + continue; + } + $markup .= str_repeat(' ', $ident + 2) ."<varlistentry>\n"; + $markup .= str_repeat(' ', $ident + 3) .'<term><parameter>'. ($param ? $param : 'param'. $count) ."</parameter></term>\n"; + $markup .= str_repeat(' ', $ident + 3) ."<listitem>\n"; + $markup .= str_repeat(' ', $ident + 4) ."<para>\n"; + $markup .= str_repeat(' ', $ident + 5) ."Description...\n"; + $markup .= str_repeat(' ', $ident + 4) ."</para>\n"; + $markup .= str_repeat(' ', $ident + 3) ."</listitem>\n"; + $markup .= str_repeat(' ', $ident + 2) ."</varlistentry>\n"; + $count++; + } + $markup .= str_repeat(' ', $ident + 1) ."</variablelist>\n"; + $markup .= str_repeat(' ', $ident) ."</para>"; + + $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', $markup, $content, 1); + } + } else { + $content = preg_replace('/\{PARAMETERS\}/', '<void />', $content, 1); + $content = preg_replace('/\{PARAMETERS_DESCRIPTION\}/', '&no.function.parameters;', $content, 1); + } + + $content = gen_method_markup($method, $content); + $content = gen_function_markup($function, $content); + + return $content; +} +/* }}} */ + function gen_class_markup(ReflectionClass $class, $content) { /* {{{ */ $id = format_id($class->getName()); @@ -640,9 +740,16 @@ create_dir($path); $INFO['actual_file'] = $filename; - $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); - $content = gen_method_markup($obj, $content); - + $INFO['mappeds'][] = $filename; + + /* Mappeds */ + if ($function = find_function($INFO['actual_extension'], $obj, NULL)) { + $content = file_get_contents(dirname(__FILE__) .'/mapping.tpl'); + $content = gen_mapping_markup($obj, $function, $content); + } else { + $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); + $content = gen_method_markup($obj, $content); + } save_file($filename, global_check($content)); break; @@ -666,15 +773,29 @@ break; case DOC_FUNCTION: - $path = $OPTION['output'] .'/functions'; - $filename = $path .'/'. format_filename($obj->getName()) .'.xml'; - $INFO['actual_file'] = $filename; - - create_dir($path); - - $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); - $content = gen_function_markup($obj, $content); - + if ($method = find_function($INFO['actual_extension'], NULL, $obj)) { + $path = $OPTION['output'] .'/'. strtolower($method->class); + $filename = $path .'/'. format_filename($method->name) .'.xml'; + + if (in_array($filename, $INFO['mappeds'])) { + return; + } + + create_dir($path); + $INFO['actual_file'] = $filename; + + $content = file_get_contents(dirname(__FILE__) .'/mapping.tpl'); + $content = gen_mapping_markup($method, $obj, $content); + } else { + $path = $OPTION['output'] .'/functions'; + $filename = $path .'/'. format_filename($obj->getName()) .'.xml'; + + create_dir($path); + $INFO['actual_file'] = $filename; + + $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]); + $content = gen_function_markup($obj, $content); + } save_file($filename, global_check($content)); break; } @@ -768,7 +889,7 @@ /* }}} */ $OPTION = array(); -$INFO = array('actual_extension' => false); +$INFO = array('actual_extension' => false, 'mappeds' => array()); $WARNING = array(); $OPTION['extension'] = NULL; $OPTION['method'] = NULL; @@ -804,7 +925,7 @@ switch ($opt) { case 'v': case 'version': - printf("%s\n", '$Revision: 1.28 $'); + printf("%s\n", '$Revision: 1.29 $'); break; case 'V': case 'verbose': http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/function.tpl?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/scripts/docgen/function.tpl diff -u phpdoc/scripts/docgen/function.tpl:1.8 phpdoc/scripts/docgen/function.tpl:1.9 --- phpdoc/scripts/docgen/function.tpl:1.8 Tue Mar 24 00:05:12 2009 +++ phpdoc/scripts/docgen/function.tpl Sun Apr 26 16:26:48 2009 @@ -11,7 +11,7 @@ &reftitle.description; <methodsynopsis> <type>ReturnType</type><methodname>{FUNCTION_NAME}</methodname> - {PARAMETERS} + {FUNCTION_PARAMETERS} </methodsynopsis> <para> The function description goes here. http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/method.tpl?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/scripts/docgen/method.tpl diff -u phpdoc/scripts/docgen/method.tpl:1.5 phpdoc/scripts/docgen/method.tpl:1.6 --- phpdoc/scripts/docgen/method.tpl:1.5 Tue Mar 31 04:35:53 2009 +++ phpdoc/scripts/docgen/method.tpl Sun Apr 26 16:26:48 2009 @@ -11,7 +11,7 @@ &reftitle.description; <methodsynopsis> {MODIFIERS}{RETURN_TYPE}<methodname>{FULL_METHOD_NAME}</methodname> - {PARAMETERS} + {METHOD_PARAMETERS} </methodsynopsis> <para> The method description goes here. http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/mapping.tpl?view=markup&rev=1.1 Index: phpdoc/scripts/docgen/mapping.tpl +++ phpdoc/scripts/docgen/mapping.tpl <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="{CLASS_NAME_ID}.{METHOD_NAME_ID}" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>{FULL_METHOD_NAME}</refname> <refname>{FUNCTION_NAME}</refname> <refpurpose>The {METHOD_NAME} purpose</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Object oriented style (method):</para> <methodsynopsis> {MODIFIERS}{RETURN_TYPE}<methodname>{FULL_METHOD_NAME}</methodname> {METHOD_PARAMETERS} </methodsynopsis> <para>Procedural style:</para> <methodsynopsis> <type>ReturnType</type><methodname>{FUNCTION_NAME}</methodname> {FUNCTION_PARAMETERS} </methodsynopsis> <para> Description here. </para> &warn.undocumented.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; {PARAMETERS_DESCRIPTION} </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Description... </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php /* ... */ ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[.... ]]> </screen> </example> </para> <para> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php /* ... */ ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[.... ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><methodname>Classname::Method</methodname></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->