Page 3 of 3
Re: Extending PHP method/property modifiers
Posted: Wed Aug 05, 2009 8:31 am
by VladSun
koen.h wrote:Going the performance route, I'm going to reask the following question:
"Do you have to get them out of the db one by one and check them, or can you do it in one query (eg SELECT * FROM posts WHERE allowed to view)?"
I think the solution will work when you have the object, but how do you know what objects you can retrieve from a database?
Still figuring out the best way to do it

Give me some more time

Re: Extending PHP method/property modifiers
Posted: Wed Aug 05, 2009 8:32 am
by VladSun
Jenk wrote:Something other than the performance topic.. use class constants instead of global. Global dependencies are a smell.

Yeah, I do use class constants. These "defines" were just an example trash

Re: Extending PHP method/property modifiers
Posted: Wed Aug 05, 2009 8:34 am
by VladSun
pytrin wrote:Just saw this, very very nice. I'm not sure if I'll have use for this in any upcoming project, but for stuff like financial systems this could be pretty useful.
Regarding performance, how about caching permissions for the lifetime of the process? (ie, once a method/property has been approved/denied always return the same value using a simple hash table). Might include a flag to indicate whether to allow caching or not. I would imaging APC could improve this a lot as well.
nice going Vlad!

Thanks, pytrin

I'm still not very interested in performance issues, rather than the theory and implementaion issues (I just want to make it ALIVE

)