In the Implementing PHP Classes to Interact with Oracle section earlier in this chapter, you saw an example of how to build a new class from scratch and how to reuse it then in different scripts. However, in most cases, you don't need to create a new class from scratch; instead, you may choose an existing class, say, a predefined PHP class, or a class from the PEAR library, and then customize it as needed.
This section gives an example of how the Auth
class from the Auth
PEAR package can be extended to better suit your needs. But first, to give you an idea of how the Auth
class works and when you might need it, this section provides an example of using that class itself.
Note
This section uses the PEAR::Auth
class to illustrate an object-oriented approach when it comes to using and customizing classes from open-source libraries, or built-in PHP classes. For a detailed discussion of security issues, see Chapter 6