Timm Friebe wrote:
> Come on, you don't need a long trainride for that.
I could not resist, initial code (no actual annotation parsing, yet!) is
here:
http://sebastian-bergmann.de/stuff/Annotation/Reflection/Annotation.phps
http://sebastian-bergmann.de/stuff/Annotation/Reflection/Class.phps
Timm Friebe wrote:
> Come on, you don't need a long trainride for that.
For the essence of it, no. But to make it "beautiful" ... we'll see. :-)
--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D6
Hi,
[...]
> I would like to see a PEAR (or even PECL) package that
> provides this functionality. I might even write it myself
> (given that I have a couple of long train rides coming up I
> will probably do this anyhow :-)
Come on, you don't need a long trainride for that.
http://sitten-p
>The PHP development team is usually against these kinds of OOP syntax sugar
>additions, search Google / the archives for:
I don't think this is syntactic sugar, it goes deeper into the language than
that if done right.
I like your userland implementation, but it will get slow once you start
w
Hendy Irawan wrote:
database because the metadata is already built-in. Just a rough
sketch:
[columnType: "VARCHAR", size: 20] public $name;
[columnType: "DATE"] public $birthDate;
We do exactly this in PHP 4 already. The base class gets the meta-data
from the DB and stores it in $this->_fields. No
Timm Friebe wrote:
> Extend (or wrap) the reflection classes and add:
>
> MyClass::getAnnotations()
> MyMethod::getAnnotations()
> MyProperty::getAnnotations()
>
> In those, parse the sourcecode with ext/tokenizer and extract all
> comments beginning with the string "#[", push them into a
Wez,
>(I added internals back in to the Cc:; presumably you missed that out
>by accident in your reply)
Thanks. Can you delete my email address from list as well please? :-) Grr.
stupid me. Hello spam bots.
I noticed I'd missed the list off cc, so I posted an edited version, which I
guess you'
Hi,
[...]
> I am playing around with an extension to the Zend Engine 2 to
> allow class properties and methods to be tagged with
> attributes. These attributes would then be accessible through
> the Reflection classes:
The PHP development team is usually against these kinds of OOP syntax sugar
On 4/18/05, Wez Furlong <[EMAIL PROTECTED]> wrote:
> Can you demonstrate some other practical use for attributes in PHP?
> (please post an example to the list, even if it's psuedo-code--we're
> mostly too busy to go off and read about something new until we've
> been persuaded it's worth doing ;-)
(I added internals back in to the Cc:; presumably you missed that out
by accident in your reply)
> Interfaces don't really provide this sort of functionality - take a look at
> c#,
> java or ruby to see
> better examples than mine of how attributes are used
Telling me to go and look at another l
>PHP has interfaces for this kind of thing, and they're clearer/cleaner
>to use than the code you've posted (for this case at least).
Interfaces don't really provide this sort of functionality - take a look at c#,
java or ruby to see
better examples than mine of how attributes are used.
I suppos
On Mon, 18 Apr 2005, George Schlossnagle wrote:
>
> On Apr 18, 2005, at 8:26 AM, Wez Furlong wrote:
> >
> >From a technical viewpoint, how do these attributes affect the class?
> > Are they simply no-ops that are tagged and made available via the
> > reflection API? How does this really help imp
On Apr 18, 2005, at 8:26 AM, Wez Furlong wrote:
From a technical viewpoint, how do these attributes affect the class?
Are they simply no-ops that are tagged and made available via the
reflection API? How does this really help improve PHP? I know it
sounds cool, but so does recording phpdoc commen
On 4/18/05, Wez Furlong <[EMAIL PROTECTED]> wrote:
> PHP has interfaces for this kind of thing, and they're clearer/cleaner
> to use than the code you've posted (for this case at least).
Yea, I completely agree.
> I'm not against the idea per-se, I just can't see a really good reason
> to justify
> I am playing around with an extension to the Zend Engine 2 to allow class
> properties and methods to be tagged with attributes. These attributes would
> then be accessible through the Reflection classes:
Sorry guys to just jump in, but Duncan's idea is an EXCELLENT idea IMHO... :-)
Let's go be
PHP has interfaces for this kind of thing, and they're clearer/cleaner
to use than the code you've posted (for this case at least).
It's also worth noting that the rendering of serialized data for an
object is usually better handled by the class of that object, not its
container. It is fine, of c
Hello,
I am playing around with an extension to the Zend Engine 2 to allow class
properties and methods to be tagged with attributes. These attributes would
then be accessible through the Reflection classes:
!-- example -!
class Storable {
[serializer:toString; pers
17 matches
Mail list logo