Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14906 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19687 invoked by uid 1010); 13 Feb 2005 18:06:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 19634 invoked from network); 13 Feb 2005 18:06:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2005 18:06:12 -0000 X-Host-Fingerprint: 81.58.153.132 dslam132-153-58-81.adsl.versatel.nl Received: from ([81.58.153.132:10113] helo=127.0.0.1) by pb1.pair.com (ecelerity 1.2.11 (r4403)) with SMTP id 87/98-21559-7F69F024 for ; Sun, 13 Feb 2005 13:05:43 -0500 Received: from [127.0.0.1] by 127.0.0.1 (ArGoSoft Mail Server Pro for WinNT/2000/XP, Version 1.8 (1.8.6.1a)); Sun, 13 Feb 2005 19:08:26 +0100 To: Date: Sun, 13 Feb 2005 19:08:24 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcURuZvGmMQnEz82TS6JybfJ/by8MwAF9DOAAAMop4AABjuIkA== Message-ID: Subject: FW: [PHP-DEV] Autoboxing in php 5.1 From: D.Kingma@jool.nl ("David Kingma | jool.nl") Hello Marcus / Adam, While I have nothing against some kind of comment parser in the PHP core, I think it's something which can be done perfectly in the userland (when the ReflectionParameter::getDocComment() is added). Instead I would like to see the XML Canonicalization functionality from libxml2 exposed in userland as a first step to enable XML-signature / XML-Encryption. Or enabling the pre/post handling of the soap request/response as a DOM, before the SOAP extension does his (great) job.(While this is possible with raw post data and outbut buffering, it would be more logical to re-use the same dom object). I'm currently trying to add the Canonicalization functionality, but since I'm not a C expert, it takes a while :) Regards, David > -----Original Message----- > From: Marcus Boerger [mailto:helly@php.net] > Sent: Sunday, February 13, 2005 11:49 AM > To: Adam Maccabee Trachtenberg > Cc: johannes@php.net; David Kingma | jool.nl; 'Andi Gutmans'; 'Sean > Coates'; 'Ante Drnasin'; internals@lists.php.net > Subject: Re: [PHP-DEV] Autoboxing in php 5.1 > > Hello Adam, > > ok, you propose a function to prepare the doc comments for further > processing. While this seems a good idea at first glance it is not > that easy as you typed it. The problem is that there are different > tags some of which stop at the next tag, some are just valid for the > word, some are valid for the current line and some are valid for a > pragraph. Thus it is better to provide an extension for that. And i > think it would be a good idea to start this as a set of php scripts. > > regards > marcus > > Saturday, February 12, 2005, 7:15:43 PM, you wrote: > > > On Sat, 12 Feb 2005, Marcus Boerger wrote: > > >> ups, reading again i see it, it was > >> ReflectionProperty::getDocComment() > > > There's a generic getDocComment() method, but that just returns the > > entire blob. You then need to parse the blog using the preg > functions > > to extract individual lines. It would be useful to have the > Reflection > > classes do this. > > > Sure, you can do this in userland code: > > > $field = 'link'; // specific comment $rc = new > > ReflectionClass($this); $dc = $rc->getDocComment(); if > > (preg_match("/@$field +(.+)/", $dc, $matches)) { > > // do something with $matches; > > } > > > But I think this would be cleaner: > > > $field = 'link'; // specific comment $rc = new > > ReflectionClass($this); $matches = $rc->getDocComment($field); > > foreach ($matches as > $match) { > > // do something with $match; > > } > > > As I would prefer to put the comment matching logic in the > reflection > > classes, so you can write tools that can rely upon a standardized > > format for supplying meta data about a class, method, etc. > > > Not a big deal one way or another, but this could solve some of the > > WSDL generation arguments (which I would love to solve) without > > requiring major language changes, such as native type hinting. > > > -adam > > -- > > adam@trachtenberg.com | http://www.trachtenberg.com author of > > o'reilly's "upgrading to php 5" and "php cookbook" > > avoid the holiday rush, buy your copies today! > > > > > -- > Best regards, > Marcus mailto:helly@php.net > >