Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57580 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41956 invoked from network); 30 Jan 2012 17:15:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2012 17:15:15 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.214.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.214.170 mail-tul01m020-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:46515] helo=mail-tul01m020-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/DA-53934-320D62F4 for ; Mon, 30 Jan 2012 12:15:15 -0500 Received: by obbup3 with SMTP id up3so4604531obb.29 for ; Mon, 30 Jan 2012 09:15:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.231.38 with SMTP id td6mr29871299obc.47.1327943712804; Mon, 30 Jan 2012 09:15:12 -0800 (PST) Received: by 10.60.20.1 with HTTP; Mon, 30 Jan 2012 09:15:12 -0800 (PST) In-Reply-To: <1327936898.1876.432.camel@guybrush> References: <1327883576.6780.722.camel@guybrush> <1327936898.1876.432.camel@guybrush> Date: Mon, 30 Jan 2012 12:15:12 -0500 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= , internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d044631fe488ff404b7c1fda9 Subject: Re: [PHP-DEV] ReflectionFile missing From: rasmus@mindplay.dk (Rasmus Schultz) --f46d044631fe488ff404b7c1fda9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Well, my thinking was, in my annotation engine, rather than globally registering aliases for fully-qualified annotation-type class-names, I would support the use-statement. This is generally how it works in other languages (such as C#) that have built-in support for annotations. So you'd be able to say "use VendorName\AnnotationLibrary\SomeAnnotation" at the top of your script, and emulating the PHP name-resolution rules, you would then be able to annotation classes/properties simply with "@some" rather than the full class-name. I know this is very specific to my project, but I could see this being important to other aspects of meta-programming with PHP in general. Clearly I'm not the first person who has needed this - there are numerous (more or less complete) implementations around the net... Although as said, I see your argument about time/effort vs usefulness, and I do agree, there are probably other areas of PHP in need of more immediate attention than this one. It is a problem that can be solved with user-code, although, as always, that means varying APIs of varying quality, and most likely some degree of duplication, since each library that needs these feature is going to implement this feature in different ways... 2012/1/30 Johannes Schl=FCter > On Mon, 2012-01-30 at 09:33 -0500, Rasmus Schultz wrote: > > From my point of view, the concept of a "file" has become semantically > more > > important, and increasingly relevant to Reflection, with the latest PHP > > features added in the past couple of years. > > > > I can see what you mean though - it's probably not a small effort, and > > there are probably more important aspects of PHP that need attention... > > When at runtime do you need this? - I can see the need for doing it > "statically" when building some form of autoloading map or such. > > For static analysis I (in my personal, probably narrow) opinion see > little benefit in doing it from within PHP (see other part of the > thread) > > johannes > > > --f46d044631fe488ff404b7c1fda9--