MadaConsole – A debug console for Zend Framework

Posted in PHP at 11:32 am by Madarco

Building Facebook applications with Zend Framework, I've needed a debug console that can shows messages even in a Facebook canvas page, through an ajax request or a redirect.

For this purpose I've build a custom plugin for ZF that fits the need: it will sit under your pages and shows all your dumped object, messages and queries.

MadaConsole debug console

MadaConsole debug console

Usage is really simple: copy in your library and add the plugin in your Boostrap or application.ini.
For a detailed guide see below.

Features

  • Trace custom messages easily: debug("A debug message");
  • Dump variables easily in your code with the pass-through function:
    Before: array_count_values($arr); After: array_count_values(debug($arr));
  • Shows the queries executed by your Zend_Table
  • Shows debug messages even through redirects or ajax requests

Install

Installing the plugin is simple:

  1. Download the archive: MadaConsole
  2. Unzip the library folder of the archive in the library folder of your Zend Framework application

Then you can configure it with two methods: through your application.ini or in the Bootsrap class.

Method1: application.ini

Add those lines after [development : production]:

pluginPaths.MadaConsole = "MadaConsole"
resources.console = true

Method 2: Bootstrap class

Add this method:

PHP:
  1. public function _initConsole() {
  2.      return MadaConsole_Console::initialize($this);
  3. }

Usage

Now in your code you can do:

PHP:
  1. debug("A debug message");
  2. debug($myArray);
  3.  
  4. $data = debug($myModel->findAll());
  5. //It will recognize Zend_Db_* objects

With the pass-through functionality you can simply add the debug() function in your existing statements with ease: $var = debug(my_func($foo));

To see the debug output when you do an ajax request, you can open a page of your choice in another browser window: the debug console will show all the messages site-wide.

Downloads

MadaConsole plugin
MadaConsole example Zend Framework project

How the debug console looks like

How the debug console looks like

Opera’s response to Google Weave: Opera Unite

Posted in General at 11:44 am by Madarco

Wonderfl – Collaboratively build flash demos

Posted in Flash at 5:49 pm by Madarco

First Flash10 P2P application unveiled

Posted in Flash at 12:34 pm by Madarco

Read the rest of this entry »

RegExr – Write and share regular expressions

Posted in Flash, General at 9:55 am by Madarco

Read the rest of this entry »

Using Zend_Tool in Eclipse

Posted in General at 9:29 pm by Madarco

Read the rest of this entry »

Haxe on the iPhone

Posted in Flash at 11:15 am by Madarco

Read the rest of this entry »

Build a Facebook application with Zend Framework

Posted in PHP at 4:56 pm by Madarco

Read the rest of this entry »

Anamanaguchi 8bit band

Posted in General at 1:21 pm by Madarco

Read the rest of this entry »

Google Chrome on TV

Posted in General at 9:55 am by Madarco

Read the rest of this entry »