fahad19

Personal blog of Fahad Ibnay Heylaal, writing mostly about web development with a focus on his open source project Croogo.

DebugKit plugin for Croogo

Posted by Fahad on Mon, Sep 06 2010

If you are a CakePHP developer, you must know about DebugKit plugin by Mark Story already. It provides a debugging toolbar and enhanced debugging tools for CakePHP applications. As far as I remember, it is the first plugin I tried in my applications and this may be the case for most developers too.

So why am I posting it here again? Just to demonstrate how it can be used with Croogo's plugin/hook system. A few weeks ago, I forked DebugKit and made it Croogo ready so anyone can upload it from the admin panel and start using it without having to worry about editing php files (app_controller.php here) manually.

All I did was add two files under a new directory 'config' to this awesome plugin, and done! First was an YAML file and the other was a PHP file. The file structure looks like this:

  • /app/plugins/debug_kit/
    • config (the new directory)
      • debug_kit_bootstrap.php
      • plugin.yml
    • controllers/
    • models/
    • views/
    • ...
    • debug_kit_app_controller.php
    • debug_kit_app_model.php

The YAML file

plugin.yml file is used for storing basic information about the plugin like it's description, author's name, website, etc. It can also contain information like it's dependencies. But we don't need anything like that for this plugin now:

name: DebugKit
description: DebugKit plugin

author: Mark Story
authorEmail:
authorUrl: http://mark-story.com

The plugin's bootstrap file

debug_kit_bootstrap.php is loaded every time the application bootstraps (only when the plugin is active). It handles configuration so DebugKit's Toolbar component is loaded in every controller.

<?php Croogo::hookComponent('*', 'DebugKit.Toolbar'); ?>

If you wanted the component to load only in, say, Users controller:

<?php Croogo::hookComponent('Users', 'DebugKit.Toolbar'); ?>

That wasn't too difficult, right? Now you can log in to Croogo's admin panel and activate the plugin from Extensions > Plugins page and you will see the toolbar at top right of your browser immediately. You can also deactivate it once you are done with debugging.

To learn more about how plugins work in Croogo, read the wiki.

Download

Get the modified version of DebugKit from http://github.com/fahad19/debug_kit.

Posted in Croogo, Plugins | Leave a comment

Croogo 1.3.2 released!

Posted by Fahad on Sat, Sep 04 2010

Let's call this version Plugins-Are-Awesome version! I have spent more time thinking than actually coding about how plugins can integrate themselves with the whole application more easily without having to touch the core. And I believe, I have been able to take the right direction. Still a long way to go. This release consists of 55 commits resolving 18 tickets, and fixing a number of bugs.

Download

Download the latest version from GitHub: http://github.com/croogo/croogo/downloads.

Changelog

See all commits for this release on GitHub, and tickets on LightHouse.

New and improved plugin/hook system

The major change in this release is how plugins work in Croogo. Previously, administrators were given the ability to activate/deactivate a helper or a component (hook) individually, which is bad because it expects the administrator to know about CakePHP development. But now you activate/deactive a plugin as a whole only, which is easier to understand for non-developers. And it is from the plugin's own bootstrap file that you decide which items to hook (let it be a component, helper, behavior or routes). The administrator doesn't need to know what happens there.

Upgrading existing Croogo installations

There has been no change in the database schema since the last release. A simple 'git pull' should update everything smoothly (like my blog). If you have developed plugins utilizing the hook system of Croogo, you should read the Developers section of the new wiki.

Site is up with documentation!

Yes, I know I have been very slow (may be lazy) with documentation. One of the reasons is that things were continuously being improved for more flexibility and ease of use. But the API is getting pretty stable now, and there is no reason for not writing documentation. Check out the site here at http://croogo.org. I will be writing for the next few weeks constantly, and once the wiki is in a decent shape, I will turn it into a git/markdown based wiki so user contribution and translation becomes easier.

What's next?

Next release will be all about user experience (aka UX). There will be a more usable and accessible (and of course, good looking!) admin panel. I lack skill in designing area, so if any of you want to share your experience and send suggestions, please post on Google Group. Submitting screenshots highlighting the good parts of other existing solutions would help too. Mockups would be highly appreciated!

If the project progresses at the current speed, I am positive that a stable version will be available in the next three releases. But don't expect a label of 'stable' unless there is decent test case coverage.

Extensions

An extensions directory could be up soon. And it largely depends on the number of community contributed plugins and themes. I can see a number of plugins being developed already, but there aren't many theme designers interested in Croogo yet. So if your friend is a designer, make sure you recommend Croogo to him/her!

Enjoy and Happy Baking!

Posted in Croogo | 2 Comments

My MacBook Pro

Posted by Fahad on Thu, Jul 01 2010

Guess what, today I became a proud owner of a MacBook Pro! It has been years I wanted a mac, and today is the day I get to lay my hands on one. I have no idea about mac apps, so if you know of any essential mac application that a web developer may require, do let me know!

macbook pro

Posted in Personal, Mac | 18 Comments
1 | 2 | 3 | 4 | 5

Navigation

  • Blog
  • About
  • Contact

Categories

  • Uncategorized
  • Croogo
  • Site news
  • Personal

Recent Posts

  • DebugKit plugin for Croogo
  • Croogo 1.3.2 released!
  • My MacBook Pro
  • Croogo 1.3.1 released!
  • Minimal theme

Meta

  • Site Admin
  • Entries (RSS)
  • Comments (RSS)
Powered by Croogo with Minimal Theme.