I started with the controller; which is simply index.php with defines and requires. The required includes are:
- Common functions and classes
The init code sets globals and not much else.
The common code will define common functions and classes used by all other nuggets of code.
The template code defines a parent class for common template properties (like title), methods for handling caching generated body output, methods for raw text input, and methods for common manipulation of buffered data.
The actions code handles the requests, dispatching them to separate included files. Some includes will be sub-structured depending upon common requirements. Some actions are ID based, like "show" and "wiki" and "test". Each included module will create one of the child template objects (defined above).
The "done" code will clean up any common messes, which isn't much.
One of the things I do not like about most frameworks written for PHP is they always define classes and variables even if they will never be used during the GET. For example, if no database access is performed then why include the database code to define the classes and variables, or worse yet – make a database connection. The only time this should happen is if every single page generated by the framework has some database element.
One reason why I'm attempting to keep things straight forward and simple is because eventually my host will force me to be limited and simple. Having Apache2 and PHP5 running on my workstation with full access to our Oracle system and SQL servers and mySQL locally (if I want) is wonderful. If I copy this to my own domain, however, I might not have the luxury of even mySQL being available.
The important thing is I learned something and it works for me (so far). All I need to do is "pretty" it up with some CSS and fill in the setHead and setAss methods of the XHTML child class and I'll be happy. Oh well, it's late on a Friday - I should be going home now. Have a nice weekend everybody!