Forum Moderators: coopster
I am working on a new component layer to make things much simpler on possible developers ( core devs if I ever get any help and addon developers ).
I basically check if a component is set ( everything runs on components, think Joomla for a second ). If found, it will require the component file. If the component file is a class and auto_start is defined as true, it will auto instantiate the class.
It used to pass about 6 or 7 system related class objects to the constructor ( database, configuration, core methods and supporting functions, as well as an xml parser / cacher, a plugin object and a user object ).
What I have decided to do now, instead of passing all these vars, is to package the vars into an array and just pass the array.
The array index is the class name basically ( so there is arr['database'], arr['config'], etc etc ). I really am not sure if this is degrading performance or not. I think its easier to deal with, although it extends calling or using any of the vars ( $system['core']->title('Page Title') ).
Performance wise, should I reconsider using an array to contain all the objects and return to passing all these objects to the constructor, or is this fine on performance?
I am trying to keep the CMS running quick and smooth, but I also want to make it easy for others to develop for or customize for their own personal uses.