Re: Looking for a package-name: PHP::Prototypes
| From: | Jan Kneschke | Date: | Mon, 29 May 2006 23:28:12 +0000 |
| Subject: | Re: Looking for a package-name: PHP::Prototypes | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-42674@lists.php.net to get a copy of this message | ||
On Tue, May 30, 2006 at 12:45:16AM +0200, Bertrand Mansion wrote:
> Jan Kneschke wrote:
>
> >Is PHP::Prototypes a obvious choice for the namespace ? Or is it
> >implying that is prototypes a php-application ?
>
> Hi Jan,
>
> Is there any reason why you can't you use the reflection API for that ?
> <http://fr3.php.net/language.oop5.reflection>
As already pointed out by another mail:
1. the internal code is not aware of reflection yet. the php-shell is
using reflection of possible, the extrator only fills the gap where php
functions are touched.
E.g.: use reflection on fopen():
>> $r = new ReflectionFunction( 'fopen' )
object(ReflectionFunction)#14 (1) { .. }
>> $r->getNumberOfParameters( )
int(0)
>> $r->getParameters( )
array(0) { }
Or use the information of the prototype:
>> ? fopen()
/**
* Open a file or a URL and return a file pointer
*
* @params string filename, string mode [, bool use_include_path [, resource context]]
* @return resource
*/
2. Even if the php functions are made aware of reflection there is still
a huge userbase which is using older versions. It's the same story as
'php -a' vs. 'PHP::Shell'.
> Bertrand Mansion
Jan
--
Jan Kneschke http://jan.kneschke.de/
Perhaps you want to say 'thank you, jan': http://jk.123.org/wishlist/