上QQ阅读APP看书,第一时间看更新
Building software that makes full use of PHP5 involves creating numerous classes that model aspects of the problem being solved. It is usually convenient to keep each one in its own file. But this makes it difficult to keep track of whether a class is already loaded.
The neatest PHP5 solution to the problem is to implement a generalized autoload mechanism for classes. This chapter has shown that it need not be especially complex, even when built to be very flexible, and to handle dynamic additions to the stock of classes.
In the next chapter, another important general area is discussed—the provision of services that will help with the use of a database.