By now, I hope that you are persuaded by architectural security and practical coding considerations that development is best done by the creation of as many classes as are needed to solve the problem, with each usually in its own file. Fortunately, PHP 5 is clearly designed to support this scenario. How does it do it?
In version 5.1.2, PHP provides an improved version of what we need: the
spl_autoload_register function. We are going to build our class management logic into a class called
smartClassMapper. It will have a subclass called
smartAdminClassMapper, which also knows about the classes used exclusively on the administrator side of our CMS, but is not described in any detail here. Our call to set ...