Re: Make PhD work with new xml:id's for methods
| From: | Hannes Magnusson | Date: | Mon, 26 Nov 2007 13:49:40 +0000 |
| Subject: | Re: Make PhD work with new xml:id's for methods | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969378380@lists.php.net to get a copy of this message | ||
On Nov 26, 2007 3:09 AM, Edward Z. Yang <edwardzyang@thewritingpot.com> wrote:
> The new OO skeletons mandate that methods be named as
> xml:id="classname.methodname". Unfortunately, PhD hasn't been taught to
> handle these new names properly (Thanks Hannes!) This patch fixes this.
> We may want to consider factoring the function name <=> munged function
> name <=> doc filename into its own function as it is something that
> shows up quite often.
> --
> Edward Z. Yang GnuPG: 0x869C48DA
> HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
> [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
>
> Index: themes/php/phpdotnet.php
> ===================================================================
> RCS file: /repository/phd/themes/php/phpdotnet.php,v
> retrieving revision 1.29
> diff -u -r1.29 phpdotnet.php
> --- themes/php/phpdotnet.php 25 Nov 2007 20:29:30 -0000 1.29
> +++ themes/php/phpdotnet.php 26 Nov 2007 02:05:51 -0000
> @@ -367,9 +367,20 @@
>
> public function format_function_text($value, $tag, $display_value = null) {
> if ($display_value === null) $display_value = $value;
> +
> $link = strtolower(str_replace(array("__", "_", "::",
> "->"), array("", "-", "-", "-"), $value));
> -
> - if ($this->CURRENT_FUNCTION === $link || !($filename =
> PhDHelper::getFilename("function.$link"))) {
> + $oop_link = strtolower(str_replace(array("_", "::",
> "->"), array("", ".", "."), $value));
Shouldn't the underscore be replaced with dash?
Granted that internal PHP methods are supposed to use camelCasedNames
I bet some extension will break this convention at some point.
Also, we should probably ditch this leftover from phpbook-xsl and
match against the <refname>s to make it possible to both do
<function>ext_funcname</function> and
<function>ClassName::methodName</function>.
-Hannes