Re: How to publish docs for a PECL package
| From: | Elizabeth M Smith | Date: | Fri, 05 Dec 2008 02:09:13 +0000 |
| Subject: | Re: How to publish docs for a PECL package | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-5965@lists.php.net to get a copy of this message | ||
Christian Hammers wrote:
> Am Thu, 04 Dec 2008 21:32:42 -0200
> schrieb Felipe Pena <felipensp@gmail.com>:
>
>> Hi Christian,
>>
>> Em Sex, 2008-12-05 às 00:02 +0100, Christian Hammers escreveu:
>>> docgen seems unable to get the types and names of the arguments
>>> from PECL methods. I assume that my "proto" lines inside the *.c do
>>> not get into the shared object.
>>> Is there any workaround? If so it should be documented, too.
>>>
>>> Warnings:
>>> - en/reference/idn/functions/idn-to-ascii.xml
>>> -- Parameter name not found, param1 used
>>> -- Type hint for parameter `1' not found, 'string' used
>>>
>> This because idn extension doesn't use arginfo structs.
>>
>> The docgen works based on Reflection info, which access information
>> about parameters using the arginfo structs.
>>
>> For example, for count() function we have:
>>
>> ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1)
>> ZEND_ARG_INFO(0, var)
>> ZEND_ARG_INFO(0, mode)
>> ZEND_END_ARG_INFO()
>
> Ah, thanks! Now the idn extension does use arg info :)
>
> But there is still no way to get type hinting, or?
>
> bye,
>
> -christian-
If you mean scalar type hinting... no
You can do "type hinting" the way PHP supports it - you can use
ZEND_ARG_ARRAY_INFO for arrays and ZEND_ARG_OBJ_INFO for a specific
object type
If you're using zend_parse_parameters (or it's cousin
zend_parse_method_parameters) dealing with parameters should be fairly
easy and have standard error messages
Thanks,
Elizabeth