An upgrade from cakePHP 2.2 to 2.3 with DebugKit

An upgrade from cakePHP 2.2 to 2.3 with DebugKit

For my latest project, ParentApprovedSchools.com, I was lucky enough to do a fresh install of cakePHP 2.3. And with that, I found the handy-dandy plugin called DebugKit right there in the cakePHP install directions. So I gave it a try. It's pretty much amazing.  Clients that see the site in development no longer ask me, "what's all this stuff below the footer?" when I have debugging turned on and I can still see a whole var dump. Pretty amazing, I know.

But once I got that all set up, I though, "hey, why not get this installed on your other projects like pawlister?" With a quick git submodule add, I had DebugKit installed.

git submodule add \
	https://github.com/cakephp/debug_kit.git Plugin/DebugKit

However, that's where the problems started.  Cake's plugin system now works by kind of duplicating the cake directory structure, but in the plugins folder for each plugin. The javascript and css and images were returning 404's on the server for DebugKit which obviously makes it not work.  First thought: they've changed something in the app directory that I don't have since I only updated the cake library.  Makes sense to check out the ~/webroot/.htaccess file, right? Well there was a tiny difference in there, but it didn't help. Still had the 404's. I checked the routes.php file next; found nothing new. So instead of looking through each file, I ran a diff. Found an interesting piece of code that's supposed to be in ~/Config/bootstrap.php about writing configuration for the Dispatcher filer. So I copy that over and BAM! no more 404's and DebugKit is working perfectly.  Here's the code that needs to be added:

Configure::write('Dispatcher.filters', array(
	'AssetDispatcher',
	'CacheDispatcher'
));