11 December 2011

A Catalyst Controller for Debugging

Topics: Web Development

This is a single controller application with no dependencies beyond Catalyst 5.90. It provides useful information about your application and environment. If you’re working on your server configuration, create a dummy app and drop this in as your root controller, see what is getting sent back to your server. If you’re having an issue with a specific application add it as a Controller in that application. If you point a form at it, it will dump the raw values being returned from that form.

Click here to view the Source for the Debug Controller.

The single controller provides 4 pages:

  • (/) The Default Catalyst Page.
  • brief - A short page.
  • spew - a long page (Includes output of form).
  • form - dumps all form values from a submitted form.

If you create a new app just replace the Root.pm file with this one, except for the first Package line. If you are putting this in a Controller in your application, remove the lines that say \_\_PACKAGE\_\_->config( and sub default Path {.

When you deploy your application remember that spew dumps out the contents of your catalyst configuration file and that you may want protect that page or disable the controller in your production environment.