Web design seattle - Chapter 4: Architecture of an Intranet Application Creating
Chapter 4: Architecture of an Intranet Application Creating a Built-In Debugger Class When developing applications, each developer uses at least some form of debugging. Although PHP-supported Integrated Development Environments (IDEs) are becoming available, they re still not the primary development tools for most PHP developers, who are still using echo, print, and printf functions to display debugging information during development. The debugging class called class.Debugger.php is a bit more advanced than the standard echo, print, and printf messages. It provides a set of facilities that include . Color-coding debug messages . Automatically printing debug line numbers . Optionally buffering debug messages . Prefixing debug messages with a given tag to make it easy to identify messages in a large application Listing 4-3 shows the debugger class that is part of our application framework. It can be used to perform basis application debugging. Listing 4-3: class.Debugger.php color = $params[ color ]; $this->prefix = $params[ prefix ]; $this->line = 0; $this->buffer_str = null; $this->buffer = $params[ buffer ]; $this->banner_printed = FALSE; Continued