Search

Drake and Jake, integrating CakePHP with Drupal and Joomla

Summary:

Just a few days ago, we launched two open source projects that have proven to be long awaited by the CakePHP developers community: Drake and Jake. Drake is a module for Drupal that lets you execute CakePHP applications inside Drupal without having to modify existing source code. Jake, its sibling project, does the same for Joomla, another popular Content Management System, supporting both Joomla 1.0 and Joomla 1.5. Let's learn how you can use Jake and Drake for your CakePHP integration project.


CakePHP (also known as simply Cake) is probably the best rapid development framework for PHP, and because of that it has experienced an almost unprecedented popularity in the last few months. Big time players like IBM and Firefox are already working with the framework to build their own set of applications, and recent experience confirms that the excitement around CakePHP is here to stay.

As CakePHP adopters were increasing, a common idea started to forge: isn't it time someone builds a Content Management System using Cake as its foundation? Even when the question may still apply, two projects seem to be questioning the validity of such an idea.

Drake is a module for Drupal that allows CakePHP applications to be run inside Drupal transparently. It's being offered as a module for Drupal 5.1 (Drupal's latest stable release) that requires no modification on Drupal's source code, nor the CakePHP applications that can run with Drake.

Drake running a CakePHP application on Drupal 5.1Drake running a CakePHP application on Drupal 5.1

Jake does the same but for another popular CMS: Joomla. Unlike Drake, Jake is packaged as a one-click installable plugin for both of Joomla's main releases: Joomla 1.0 and Joomla 1.5.

Jake running a CakePHP application on Joomla 1.5Jake running a CakePHP application on Joomla 1.5

On both cases, you can take full advantage of the CMS-CakePHP integration. When running through Drake or Jake, CakePHP applications are running on top of their respective CMS framework, which ultimately means that those APIs provided by either Drupal or Joomla are available for your applications to use. Furthermore, and since on of the main goals behind these two projects is that your applications should be able to run with or without Drake/Jake, you can easily tell when it is being run through any of those two bridges. Drake sets a PHP define named DRAKE, and Jake one named JAKE so your applications now they are running through them. For example, inside your CakePHP application controller you can do something like this:

if (defined('DRAKE') || defined('JAKE')) {
        $this->layout = 'bridge';
}

To change your application layout to one named bridge when it is being run through any of the bridges.

No matter what your CMS of choice is, you can now build Web 2.0 applications taking advantages of the broad set of functionalities CakePHP offers and run them on top of a full-featured Content Management System, giving you endless possibilities as to what you can achieve.


Reply

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code lang="LANGUAGE">...</code> where LANGUAGE is a valid GeSHi language (such as php).
  • Images can be added to this post.
  • Use <!--pagebreak--> to create page breaks.

More information about formatting options

Valid XHTML 1.0 Strict - Running on Drupal 5.2