Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64614 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71926 invoked from network); 6 Jan 2013 22:50:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jan 2013 22:50:53 -0000 Authentication-Results: pb1.pair.com header.from=g.b.yahav@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=g.b.yahav@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.182 as permitted sender) X-PHP-List-Original-Sender: g.b.yahav@gmail.com X-Host-Fingerprint: 209.85.214.182 mail-ob0-f182.google.com Received: from [209.85.214.182] ([209.85.214.182:51448] helo=mail-ob0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/0A-04877-BCFF9E05 for ; Sun, 06 Jan 2013 17:50:52 -0500 Received: by mail-ob0-f182.google.com with SMTP id 16so16577636obc.27 for ; Sun, 06 Jan 2013 14:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=lcfNtVFBT8ds2BhpKNV/MQ2VU3LATs7qKYi9TS+sNek=; b=fI2ysAZA+tj6zIZo0/ry5g+XcnjX9vlCTCcW60Msmbtuu0G0mlrZzmnXrSihm5VDk1 KPSPQvxkINs7tWEbdlCCjUsI24UesbLQCGvEChAwOYfpYoQPX4CMjaiU0eSBynwjNPsV vOa+GsskrjEclZmiZSUqOlBeHnmyR/7EPHlZPuuu2fFOOqEc+BeSRsfvq01bSmZ6ZXxP u7Sj4948H8GxJ7h+u3phrKqmsHIv2tkH5nuIxd8wR8z+upIW/GaHvy1BD9me4aPb3PWr Hvr4YBxNrPsT5fUjgpk7+bT1PwA6cnWC1dE9X9Ttt+n96Z/inmglNKIcpp9yirN6nldj vlpw== Received: by 10.60.13.73 with SMTP id f9mr32016162oec.131.1357512648716; Sun, 06 Jan 2013 14:50:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.151.4 with HTTP; Sun, 6 Jan 2013 14:50:28 -0800 (PST) In-Reply-To: References: <45FD2112-5469-48A2-8941-92415EC711E1@strojny.net> Date: Mon, 7 Jan 2013 00:50:28 +0200 Message-ID: To: Marco Pivetta Cc: Lars Strojny , PHP internals Content-Type: multipart/alternative; boundary=e89a8fb2027634731704d2a68b11 Subject: Re: [PHP-DEV] [RFC] Reflection annotations reader From: g.b.yahav@gmail.com (Yahav Gindi Bar) --e89a8fb2027634731704d2a68b11 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jan 7, 2013 at 12:41 AM, Marco Pivetta wrote: > > I think that our work is to isolate each annotation so it'll be easy to >> access, then, it'll be easy enough to write the code that creates "complex >> annotations", such as constructors and so on, in userland. >> > > In fact, there's probably no need (now) to go on and build a full > annotation reader that instantiates classes and does fancy stuff as we > currently do in doctrine/common. > A fast parser is more than enough I suppose. That's our bottleneck > (besides scanning files). > > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > So the problem is the syntax which is difference? When wrote this RFC, I just though about basic cases... Though I agree with you that the main problem is the syntax. We can extract the entire doc-comment and only isolate between annotations, so doc-comment like: /** * @Route("/") * @ORM(Key="foo") * @var string */ Will be : array( 'Route("/")' => "", 'ORM(Key="foo")' => "", "var" => "string" ) But the question is it really worth it, since you'll probably need to create some sort of "sub-parser" that uses this isolated annotations array and apply on them your syntax. That's being said, if we'll see performance improvements, I really think that it's a good solution to start with, since because its not an Attributes, I don't think that we should dictate the syntax for each application. Each application will get the doc-comment annotation and will be able to apply on it its own syntax and fancy stuff... I think that it's the best solution because of BC too. What do you think? --e89a8fb2027634731704d2a68b11--