I'm writing a content management system and everything is going smooth. Everything loads up just fine. However, I'm having a problem with scope.
Here's the order of operation:
1. load system classes
2. load setup file
3. initiate system classes
I currently have 6 system classes: mysql, template, site, plugins, modules, blocks.
The plugins class simply includes files taken from a DB table. (i.e. plugins/user/main.php)
The modules class does the same. (i.e. plugins/user/modules/test.module.php)
Now, plugins and modules don't output anything to the output stream at all. That's what the blocks class does.
The blocks class, in conjunction with the template class, replaces a {TAG} within a template file with the output of a PHP file. (i.e. plugins/user/blocks/test.block.php)
Now, onto my issue. I currently have only one plugin: the user plugin. Within the plugin class, when the user plugin is loaded, another class is created. So, plugins/user/main.php contains a class declaration and it initializes that class. When I try to access this class object from within the blocks class (i.e. plugins/user/blocks/test.block.php) I get an error saying that the member function references a non-object, meaning the user object wasn't found.
Where am I going wrong with my scope? I need to access a class included within the plugins class in my blocks class.
Thanks.