I am making my own mini OOP wrapper for working with wordpress themes. I have a main $settings variable that contains all of the information like definitions, scripts, menus etc..
I then pass this variable or its members to helper functions that interact with the API. This all worked fine for my setup helper that did things like register scripts and menus but now I am working on presentation functions that I will call from inside the template (header, footer etc..) and want my helper functions to access the $settings variable but it is out of scope and I am not sure what the best way to bring it into scope is.
I am not developing anything for general release and am targeting PHP 5.4. I have put all my functional code inside of namespaces so there isn't any naming clashes with plugins.
I've only been doing PHP for a couple of weeks so I am not sure what approach to take. Should I add the variable to the global array? Can inject variables some other way into page lifecycle to make them accessible? Should I serialize the variable to a flat file and then read it back?
I am sure there is simple way but it eludes me due to inexperience. Thanks for any advice.