Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50363 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34221 invoked from network); 18 Nov 2010 17:01:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2010 17:01:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 76.96.30.48 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 76.96.30.48 qmta05.emeryville.ca.mail.comcast.net Received: from [76.96.30.48] ([76.96.30.48:47381] helo=qmta05.emeryville.ca.mail.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/AC-01108-8CB55EC4 for ; Thu, 18 Nov 2010 12:01:03 -0500 Received: from omta18.emeryville.ca.mail.comcast.net ([76.96.30.74]) by qmta05.emeryville.ca.mail.comcast.net with comcast id YeAE1f0041bwxycA5h0qqe; Thu, 18 Nov 2010 17:00:50 +0000 Received: from earth.ufp ([98.220.236.211]) by omta18.emeryville.ca.mail.comcast.net with comcast id Yh0o1f00k4aLjBW8eh0pjK; Thu, 18 Nov 2010 17:00:49 +0000 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id A83DAD7A66 for ; Thu, 18 Nov 2010 11:00:48 -0600 (CST) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.ufp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AUxMn+6-G0Em for ; Thu, 18 Nov 2010 11:00:48 -0600 (CST) Received: from garfield.ad.palantir.net (unknown [209.41.114.202]) by earth.ufp (Postfix) with ESMTPSA id 735D3D7950 for ; Thu, 18 Nov 2010 11:00:48 -0600 (CST) Message-ID: <4CE55BBC.4050900@garfieldtech.com> Date: Thu, 18 Nov 2010 11:00:44 -0600 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: internals@lists.php.net References: <201011172316.44702.larry@garfieldtech.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) support discussion From: larry@garfieldtech.com ("larry@garfieldtech.com") On 11/18/10 7:34 AM, guilhermeblanco@gmail.com wrote: > Hi Larry, > > For existent project examples and usage, here are 2 links of the > upcoming versions of Doctrine 2 and Symfony 2: > > http://www.doctrine-project.org/projects/orm/2.0/docs/reference/basic-mapping/en#introduction-to-docblock-annotations > http://docs.symfony-reloaded.org/guides/validator.html > > Please understand that Roman, Benjamin, Jonathan and I wrote this > Annotation parser for Doctrine, which was reused by Bernhard on > Symfony. > So I have clean understanding of the issue we have on hands and every > single point that it is required to address. That's why I wrote the > RFC. > > Yesterday night a couple of people joined on #php.pecl and discussed a > possible new implementation. > I'll write what was discussed and probably some sample code. No offense, but as I've noted before Symfony and Doctrine are very very different types of frameworks/libraries than a lot of the code out there. Much of what may make sense in a component framework doesn't make sense in a full stack framework (e.g., Drupal, which I work on) and vice versa. So while I respect that you put a lot of work into the Doctrine and Symfony implementations that does not mean you will understand "every single point that it is required to address". That said, from looking at the Symfony page above it looks like it's an integrated system for providing variable-level validation. True? If that's the case, what would a before/after look like for code using annotations vs. not? As far as implementation goes, for something like this to be useful for a highly-dynamic system like Drupal we'd need to be able to add annotations/validation rules out-of-band, that is, from somewhere other than syntactically right on the variable/function/method being validated. We frequently have highly-generic objects that get used in a multitude of different ways, so we would need to be able to associate validation rules at runtime for them to work. Naturally the error messages from them would also need to be returned/thrown, not printed, so an application can take proper steps with them in its own error handling routines. --Larry Garfield