I am thinking of building some kind of “hook” function system. Basically a couple of functions that is run before the whole application start doing what it is suppose to do. I guess some kind of authentication would be proper to have as a hook. Check if the user is still logged in etc. There should also be some kind of priority order.
But how do I structure this kind of hook system? How do I initialize it?
I guess I would need some class to handle this for me. An add_hook and run_hooks method or something.
phpBB, the open source bulletin board software, has a hook system you might benefit from looking into. Of course much of the code will be specific to phpBB’s framework, but the basic idea would be the same, I think.