Showing posts with label Debugging. Show all posts
Showing posts with label Debugging. Show all posts

Kohana 3 :: Debugging Profiling


Kohana provides a very simple way to display statistics about your application:
  1. Common Kohana method calls
  2. Requests
  3. Database queries
  4. Average execution times for your application

Kohana 3 :: Debugging Error Handling

Error/Exception Handling

Kohana provides both an exception handler and an error handler that transforms errors into exceptions using PHP'sErrorException class. Many details of the error and the internal state of the application is displayed by the handler:
  1. Exception class
  2. Error level
  3. Error message
  4. Source of the error, with the error line highlighted
  5. debug backtrace of the execution flow
  6. Included files, loaded extensions, and global variables

Kohana 3 :: Debugging


Kohana includes several powerful tools to help you debug your application.
The most basic of these is Kohana::debug. This simple method will display any number of variables, similar to var_exportor print_r, but using HTML for extra formatting.
// Display a dump of the $foo and $bar variables
echo Kohana::debug($foo, $bar);
Kohana also provides a method to show the source code of a particular file using Kohana::debug_source.
// Display this line of source code
echo Kohana::debug_source(__FILE__, __LINE__);
If you want to display information about your application files without exposing the installation directory, you can useKohana::debug_path:
// Displays "APPPATH/cache" rather than the real path
echo Kohana::debug_path(APPPATH.'cache');