Book Image

CodeIgniter for Rapid PHP Application Development

By : David Upton
Book Image

CodeIgniter for Rapid PHP Application Development

By: David Upton

Overview of this book

<p>CodeIgniter (CI) is a powerful open-source PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. CodeIgniter is an MVC framework, similar in some ways to the Rails framework for Ruby, and is designed to enable, not overwhelm.<br /><br />This book explains how to work with CodeIgniter in a clear logical way. It is not a detailed guide to the syntax of CodeIgniter, but makes an ideal complement to the existing online CodeIgniter user guide, helping you grasp the bigger picture and bringing together many ideas to get your application development started as smoothly as possible.</p>
Table of Contents (21 chapters)
CodeIgniter for Rapid PHP Application Development
Credits
About the Author
About the Reviewers
Preface
Index

CI's Error Handling Class


CI has a system of its own for detecting and reporting errors. In one way, these are the simplest and most common tests of all: they are those helpful (or infuriating) messages you see when you are developing your own code and it doesn't work.

By default, CI displays all errors on the screen. The alternative is to fail silently; giving you no idea of what went wrong, so this is essential for development. Overall behavior is controlled from the main index.php file, which begins:

/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| By default CI runs with error reporting set to ALL. For security
| reasons you are encouraged to change this when your site goes live.
| For more info visit: http://www.php.net/error_reporting
|
*/
error_reporting(E_ALL);

This is a PHP command. To turn off error reporting, replace the last line with:

error_reporting(0);

This would...