i have some application-wide code that i am not wanting to have to include on every page...
is there a way to instantiate an "application-wide" class so i dont have to include it on every file that needs it?
thank you!
:RC:
code to run on startup?
Moderator: General Moderators
- allspiritseve
- DevNet Resident
- Posts: 1174
- Joined: Thu Mar 06, 2008 8:23 am
- Location: Ann Arbor, MI (USA)
Re: code to run on startup?
One possibility is to use mod_rewrite and redirect everything to a single file, usually index.php. This file can then load any other class/file you want. It's a simple implementation of the Front Controller pattern.
Re: code to run on startup?
It sounds like youre either talking about autoloading or a bootstrap.