[PHP-DEV] Re: Annotations Request

2008-08-25 Thread Volodymyr Iatsyshyn
Volodymyr Iatsyshyn wrote: Hi, Is there a chance to have annotations like in Java or like .NET attributes? Now, I use Java Annotations emulation, through Reflections and PHPDoc blocks. Example: /** Annotation One*/ class DemoAnnotation1 extends C01t_Annotation { public $value

Re: [PHP-DEV] Annotations Request

2008-08-21 Thread Volodymyr Iatsyshyn
Now I use emulation of Java Annotations. I wrote simple class, that uses PHPDoc block, gets annotations declarations and their arguments, uses eval() to convert arguments string to array, then I create instance of class and assigns parameters. This solution is fine just now, but it will be very

[PHP-DEV] Re: Annotations Request

2008-08-21 Thread Volodymyr Iatsyshyn
Lupus Michaelis wrote: Volodymyr Iatsyshyn a écrit : Now, I use Java Annotations emulation, through Reflections and PHPDoc blocks. Example: Can you provide an URL that explain what is annotation ? Your examples don't help me, so I guess I'm not alone. http://java.sun.com/j2se/

[PHP-DEV] Annotations Request

2008-08-20 Thread Volodymyr Iatsyshyn
DemoAnnotation2 extends C01t_Annotation { public $p1; public $p2; } class DemoClass { const SOME_CONST = 5; /** @DemoAnnotation1(DemoClass::SOME_CONST + 1) */ public $property1; /** @DemoAnnotation2(p1 => 1, p2 => 'Hello, Word!') */ public $property2; } Tha