espresto/reclaim-social-media

Make static mod-attributes non static?

Closed this issue · 2 comments

I think since we now have real class-instances and want multiple streams/channels per mod in the future we should make the attributes non static, too. What do you think?

I actually thought about this when dropping all the static foo a few days ago. Seeing how most (all?) of those remaining static vars are really just const defines (e.g. private static $count = 400;) the static declaration does the job just fine. They don't need to get allocated per class, but only once statically. Not that it'll ever make a huge difference (even when you'd use twenty instances of the bookmark mod) in reality, but it's the right thing to do.

The alternative is defining them as consts, but, if I remember my PHP correctly, then you can't declare them as private. Which is silly.

Ok. Yesterday i thought maybe there will be the need to configure some of those values per mod-channel/stream later. But we should hide those options atm to protect the user.
About the consts: maybe at some point it will be nice to get those hardcoded config values from the outside later to handle the streams differently dependent on the config value. I'm not sure but its not imported right now :-)