FirePHP and Zend Framework

Zend has a great tool for debugging ajax code. It allows error messages to be displayed directly in firebug via an additional plug-in called FirePHP.

First, visit the mozilla plug-in site and install FireBug and FirePHP.

Then add this to your zend framework projects bootstrap file.

<?php

// Place this in your bootstrap file before dispatching your front controller
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);

 

// Use this in your model, view and controller files
$logger = Zend_Registry::get(‘logger’);
$logger->log(‘This is a log message!’, Zend_Log::INFO);

?>

This plug-in saved my bacon on a recent project which has a ton of ajax parts.
There is also an adapter for zend_db_profiler which will log all queries to firebug which is also very useful.

More details here. Thanks Chris for all your hard work.

ReCaptcha Users – Update your URL

On March 8th, the reCaptcha team announced they’re changing their API URL, effective Apr. 11th, 2011.

As others have pointed out, really poor communication from reCaptcha guys. Use your blog, put it on slashdot, reach out to the communities listed on your site. Don’t just yank the rug out from under folks. A month isn’t anywhere near long enough for this important change to trickle out to all the folks integrating with your service. Paypal gave a year and a half worth of notice to is developer community before switching its api urls and that wasn’t long enough either.

Really minor change for zend framework users or other scripting languages.
ZF hasn’t offically said when they’ll update their code. There is a bug report for it.

Here is what change to get ZF ReCaptcha service working again:
Open:
/ZendFramework-1.11.0/library/Zend/Service/ReCaptcha.php


/**
* URI to the regular API
*
* @var string
*/
const API_SERVER = 'http://www.google.com/recaptcha/api';

/**
* URI to the secure API
*
* @var string
*/
const API_SECURE_SERVER = 'https://www.google.com/recaptcha/api';
/**
* URI to the verify server
*
* @var string
*/
const VERIFY_SERVER = 'http://www.google.com/recaptcha/api/verify';
[/code]
#The old urls are still working but are being redirected.

ReCaptcha has already reflected this in their documentation.