Comments

tenzing7777’s picture

I am getting older now and waiting for Drake for Drupal 6 to arrive. But Whennnnnnnnnnnnnnn?

Anonymous’s picture

I have a project that requires this (for a Drupal 6 site), so in the next month or so, I'll be working on upgrading this module. It looks like it's abandoned - the last commit was 2 years ago. If anyone else is currently working on this, please speak up!

MichaelCole’s picture

No, but rock on!

I want to write a "mega-module" and was looking for cakephp or symfony to write it in. I could totally help out on this.

Mike

smurferboy’s picture

We're currently launching a project that would also use cakephp and drupal. Is there any progress in the porting to 6 already?

Thanks,

Wouter

geste’s picture

Pearlbear,

I hope you have some luck with this. I never really took a look at it to see how complicated the module is. Drake was something I was going to "get back to sometime" and now that I actually have a working Cake application, I went back to look only to find that it appeared to be abandoned.

I am going to bring up a new Drupal 6 server with the intent to migrate off of our existing Drupal 5 system late in 2009. Wish I was smart enough to help on the module itself, but I will have a Drupal 6 system for several months with no users, so testing maybe?

Jim

burningdog’s picture

This is a newbie question, so feel free to flame me ;) But why is the integration between a framework like CakePHP and drupal useful? Why not use one or the other? Now, I know a fair bit about drupal, but haven't used a php framework before - doesn't the performance hit of running a framework inside drupal make it not worth it?

Anonymous’s picture

@geste - I'll definitely take you up on the testing. I've been a bit delayed, but I will be digging in when I get back from vacation in a week.

@Roger - no flames here. Basically, my use case is that we have a very complex client-tracking database written in cake, and users of a members-only site in drupal who I want to be able to interact with that database without a second login. I also want to pull user-specific data (pending activities, etc.) from that cake database into drupal blocks.

burningdog’s picture

@pearlbear thanks - that's a specific use-case which shows why this integration is useful :)

Anonymous’s picture

So a little news on progress and planning for drake:

1) I've done some initial work to port the module to Drupal 6 - but there are a number of snags still.

2) My first goal will be to simply recreate the functionality of the 5.x-1.x version in 6.x. When that happens, I'll figure out how to release the dev snapshot here. (I'm a newbie to how to contribute to drupal projects, or how to assume responsibility for a project, so any guidance in that realm would be especially useful. I've tried to contact the current maintainer, and have failed, so I'm assuming the project is abandoned.)

3) My project includes a need for single sign on, so I'll be adding that to this module for sure.

4) Any other suggestions on how to increase the usefulness of this module (besides dealing with current issues in the queue) are welcome.

kenorb’s picture

any news?

Anonymous’s picture

The module was pretty much a disaster. There is a *lot* of work to do (and I am a relatively new module developer). But I'm still slogging away, since this project I am doing requires it. I'll keep everyone posted.

greenc’s picture

subscribe

freedomfflow’s picture

Hey there... first day delving into Drupal... I've been using cake for a while now, but I'm far from an expert. But my projects are committed to cake at this point.

I was excited to hear about Drake, but disappointed to see its not available for Drupal 6.

I would be willing to help where I can to try and develop it, but given I know so little about drupal I'm not sure what I can do.

That said, as a drupal newbie, should I downgrade to drupal 5 so I can configure drake? What are the major drawbacks to that?

Thanks

tseven’s picture

I too am interested in see thing module ported to D6, unfortunately I have no experience with CakePHP,.... YET.

dmadruga’s picture

Subscribe.

jejk’s picture

StatusFileSize
new28.16 KB

Hello

I am quite new to Drupal but quite experienced with CakePHP.
So as my first contribution here is the D6 version of Drake.

pluess’s picture

First of all many thanks to jejk for the D6 Code. I think this code should be added as a dev Version for D6, in order we have a common base to code and patch against.

Unfortunately I don't see any sign of life from the module maintainer for the last 3 years. Is this module still supported? May be the module should be handed over to someone else?

Ths site http://dev.sypad.com/projects/drake which should provide additional information is not reachable any more. If someon has this documentation, it should be added to the drupal module documentations.

mkeplinger’s picture

We too have a need for this. Any word on the latest?

toddgee’s picture

subscribe

toddgee’s picture

@jejk any interest in becoming the official maintainer so you can check in the code to the Druapl contrib CVS?

http://drupal.org/node/251466

celia_ccs’s picture

I'm also willing to sponsor the development of Drake to D6.

mkeplinger’s picture

We have quite a few people willing to sponser the release of a Drake release for Drupal 6.x. (including me, I could three here).

It there anyone with the right skill-set, and time to put the time into creating a stable release??

kiange’s picture

Subscribe, too.

klamzo’s picture

subscribing

rowlandm’s picture

I am going to try and do this. I have recently create a cakephp application for organising sporting teams for a club and wanted to integrate it with drupal.
Wish me luck as I am only new to Drupal but do PHP for a living!

luckysmack’s picture

Subscribing

Any update on this? I could also benefit from using this.

wils.solutions’s picture

Hi Gang,

I'm in the same boat =D

I have It running, what I did:

1 - copied my cakephp app to the drupal folder

2 - changed the ini file, bellow the example:
[settings]
default = "myapp"
[myapp]
path = "myapp\app\webroot"
url = "/myapp"

3 - URL to see the magic:
http://your_drupal_host/drake/?run=images/index

Images = name of my controller

that's It!

Problems:
1 - It's loosing the Session: after a request I need to login again, the module is performing the request and destroying the session. This is being my huge problem.

My Solution: disabled the Session on CakePHP =p

I'm poking around and see what I can improve to get on It!

Anybody else would like to share own experience and tips?

tkx
Wils

rowlandm’s picture

Hi wils.solutions,

Did you use the Drake 6 that jejk mentioned?

Also, could you tell me what drake related records are in your menu_links table?

I haven't been able to get it working yet, and I can't seem to see how I could with the menu_links not being a certain way.

Thanks

Rowland

rowlandm’s picture

From jejk's code I had to change the following in drake.module to get it to kind of work.

It was for $items['drake/documentation']

$items['drake']= array(
'title' => 'Drake Dispatcher',
'page callback' => 'drake_dispatcher',
'access arguments' => array('access drake content'),
'access callback' => true
);

Also had to move the cakephp folder (which contains app cake and vendors folders) to sites/all folder

Am currently having problems with posting - perhaps it is an issue as I am using scaffolding.

rowlandm’s picture

From jejk's code I had to change the following in drake.module to get it to kind of work.

It was for $items['drake/documentation']

$items['drake']= array(
'title' => 'Drake Dispatcher',
'page callback' => 'drake_dispatcher',
'access arguments' => array('access drake content'),
'access callback' => true
);

wils.solutions’s picture

Hey Rowland,

Yes, I'm using the version from jejk.
Here you're my menu entries:

admin_menu 1456 238 admin/build/drake/get admin/build/drake/get Get Drake URL a:1:{s:5:"alter";b:1;} admin_menu 0 0 0 0 0 2 0 238 1456 0 0 0 0 0 0 0 0
Edit Delete admin_menu 1455 238 admin/build/drake/documentation admin/build/drake/documentation Documentation a:1:{s:5:"alter";b:1;} admin_menu

Hey, why is the menu information important for you?

Thank you
Wils

rowlandm’s picture

Hey Wils,

I noticed that in the jejk #17 post download that I couldn't get it working using an example like /drake?run=images/index because it was using drake/documentation to point to the drake_dispatcher module function and didn't work. So I had to add in that code

It was for $items['drake/documentation']

$items['drake']= array(
'title' => 'Drake Dispatcher',
'page callback' => 'drake_dispatcher',
'access arguments' => array('access drake content'),
'access callback' => true
);

to get it working.

Did yours work out of the box? Which Drupal version was that?

And sorry, I probably needed your menu_router table, not your menu_link table - whoops.

wils.solutions’s picture

Hey,

So, my before was working, now I'm doing a fresh setup and found new issues =P
For example: I'm getting the output, just a blank screen, however print $output; display my cakephp app without css hehehe. I'm figuring It out.

1st time I had It running on wwwroot/drupal/mycakephpapp =D now moved to /sites/all =p the problem is: both paths are visible on web :P I need to write some code to restrict access.
I'm, using Drupal6x.

Here you are the menu_route:

INSERT INTO `menu_router` VALUES('drake', '', '', '1', 'a:1:{i:0;s:20:"access drake content";}', 'drake_dispatcher', 'a:0:{}', 1, 1, '', 'drake', 'Drake Dispatcher', 't', '', 6, '', '', '', 0, '');
INSERT INTO `menu_router` VALUES('drake/documentation', '', '', 'user_access', 'a:1:{i:0;s:29:"administer site configuration";}', 'drake_dispatcher', 'a:0:{}', 3, 2, '', 'drake/documentation', 'Drake Dispatcher', 't', '', 4, '', '', '', 0, '');
INSERT INTO `menu_router` VALUES('admin/help/drake', '', '', 'user_access', 'a:1:{i:0;s:27:"access administration pages";}', 'help_page', 'a:1:{i:0;i:2;}', 7, 3, '', 'admin/help/drake', 'drake', 't', '', 4, '', '', '', 0, 'modules/help/help.admin.inc');
INSERT INTO `menu_router` VALUES('admin/build/drake/documentation', '', '', 'user_access', 'a:1:{i:0;s:29:"administer site configuration";}', 'drake_admin_documentation_page', 'a:0:{}', 15, 4, 'admin/build', 'admin/build', 'Documentation', 't', '', 136, '', '', '', 0, '');
INSERT INTO `menu_router` VALUES('admin/build/drake/get', '', '', 'user_access', 'a:1:{i:0;s:29:"administer site configuration";}', 'drake_admin_geturl_page', 'a:0:{}', 15, 4, 'admin/build', 'admin/build', 'Get Drake URL', 't', '', 128, '', '', '', 0, '');

regards
Wils

rowlandm’s picture

Cool - I didn't have the first menu_router record you had - I had to set that up.

Found out if I stop the session destroy for Drupal, my cakephp app says :

Fatal error: session_start() [function.session-start]: Failed to initialize storage module: user (path: /home/rowlandm/workspace/drupal/sites/all/cakephp/app/tmp/sessions) in /home/rowlandm/workspace/drupal/sites/all/cakephp/cake/libs/session.php on line 546

So I could get it working in this config by setting app/config/core.php Session.start to be false.

But I want my CakePHP to have Session.start so I think we will have to fix the backup/destroy/restore around the cakephp dispatch in drake module.

Will keep trying!

rowlandm’s picture

Found it!

Simple change to drake/drake.module line 314

$cakeDispatcher->setRestoreSession(true); // it was false and causing problems

So I logged into Drupal, then I jumped into drake and went to drake?run=/fixtures/index (my fixtures controller is scaffolded) and started clicking links and I was still logged into Drupal.

Try that out and let me know.

rowlandm’s picture

StatusFileSize
new28.79 KB

I've tried to put this into a .zip file. Please try and let me know how you go.

rowlandm’s picture

Things still to do:

1/ Problem with forms redirecting to the normal /fixtures instead of drake?run=/fixtures but that could just be scaffolding/routing issue

NOTE: this was an issue with the CakePHP code. I ended up using $this->flash with a long pause (1000 seconds) so that the user would be forced to click the message as if I redirect it causes problems with the restore of the session and it looks like you have logged out on Drupal when you haven't.

2/ Single sign on across Drupal and CakePHP

3/ Wils mentioned disabling access via sites/all/modules/cakephp

rowlandm’s picture

Slightly more elegant fix to problem 1 on #39 post above:

Setup an app_controller.php and override the redirect function:

class AppController extends Controller {

	/**
	 * Please note that you cannot assume the redirect will take you off the page anymore
	 * eg. In a normal bake, the delete function will show up two messages because they
	 * assumed the redirect would remove the focus away from the controller
	 */
	function redirect($url, $status = null, $exit = true){
		
		$sessionMessage = $this->Session->read('Message.flash.message');
		if ($sessionMessage != ''){
			$message = $sessionMessage.' - please click here to continue';
		} else {
			$message = 'Please click here to continue';
		}
		
		$this->flash($message, $url,1000);
		
	}
	
}

rowlandm’s picture

StatusFileSize
new851.55 KB

And the latest update to the codebase, including single sign on for CakePHP based on Drupal login (I just copied the modules and cakephp folder under sites/all folder, so you could see a cakephp example).

To get to the cakephp application use http://hostname/drake?run=/fixtures

Sorry had to use .tgz to get under 1MB upload limit.

wils.solutions’s picture

Cool buddy, I just tried to run the last one and got:
Fatal error: Cannot re-declare class view in /sites/all/modules/views/includes/view.inc on line 19

Some conflict with Drupal Views, class view extends views_db_object {

Would you to enable Views on your setup?

tks
Wils

rowlandm’s picture

Yeah - looks like there is a CakePHP class called view

class View extends Object in cake/lib/view/view.php

So I doubt that you will be able to use Drake with Views.

Could you please try a fresh Drupal install and try the last .tgz file I had. Just so I know it works for someone else!

rowlandm’s picture

StatusFileSize
new853.69 KB

Hi there,

Just updated the drake to handle $this->Session->setFlash messages nicely.

Have attached the latest version, you will need to update the app_controller as well as the drake module.

Regards,

Rowland

rowlandm’s picture

StatusFileSize
new854.04 KB

Sorry, found a couple of bugs.

1/ Problem when deleting with no delete view and
2/ Issue when no flash message being set

rowlandm’s picture

StatusFileSize
new855.16 KB

Boss told me I should use exceptions in the app_controller to provide a true redirect

So here it is.

Changes made to the app_controller in cakePHP and two files in the drake module

rowlandm’s picture

StatusFileSize
new30.41 KB

Hi there,

Further refactoring for drake.

I have created a Drake Component that you can put in your app_controller

class AppController extends Controller {
	var $components = array('Auth','Drake');
	
	/**
	 * Please note that you can assume the redirect will take you off the page 
	 * Did the redirect by using an exception
	 */
	function redirect($url, $status = null, $exit = true){
		$this->Drake->redirect($url,$status,$exit);
	}
	
}

Tested and looks good in Drupal 6 with Cake 1.2 and Cake 1.3 working.

I have just zipped up the drake module and put the drake component for CakePHP in the root directory under drake.php

mkeplinger’s picture

rowlandm - thanks for working on this project. It looks like your current work demands it. Do you have a workable port of this to Drupal 6x?

For those that comment frequently about the need for this module in Drupal 6.x, I am curious what workarounds people have been using? We are now about to investigate how to go about this without Drake, such as iFrames, PHP's virtual() function, and potentially using hook_menu()

So this post is really about 2 questions.
1. Is there a workable port of Drake for 6.x
2. What are people using as an alternative to integrate drupal and cakePHP?

mkeplinger’s picture

Also wanted to add that we have a custom module built to integrate Drupal users / permissions, with cakePHP through ACOs (Access Control Objects), and it works quite well. It could probably be adopted here, but my developer doesn't have the time to make it "generic" and support it as a module.

rowlandm’s picture

@mkeplinger

The drake.zip file on comment #47 is the workable port for Drake 6x.

Let me know how you go with it.

toddgee’s picture

@rowlandm, have you considered petitioning to become the maintainer of the project so you can check your code in?

rowlandm’s picture

No, not really. Just had a look at Drake because we had some time to do so at work. Not sure if I could continue to maintain this outside of my normal job.

edwinallenz’s picture

Assigned: data18 » Unassigned
Category: task » support

Hello every one, it seems that some work it's being doing on this module.
I'm running a test of this module and I have a problem. When I go to http://www.mysite.com/drake/?run=/mycontroller/view if I'm on debug 2, I can see all the debug messages but the view is not rendered. The same issue it's happening when I use debug 0.

This is the testing url
http://www.nktproducts.com/drake/?run=productos/index

I'm using drupal 6 and the las version of drake posted in this thread.

rowlandm’s picture

Hi edwinallenz,

Just curious if you got it working?

I'm not really in a position to have a look though, just curious. When I was testing/using this it was mainly with debug set to 2 - so I am unsure of what it might be.

Cheers

giantgoat’s picture

edwinallenz I seem to be having the same problem as you. Though it seems that whatever debug is set to I dont see the cake view at all. I know it is getting into my cake application but it doesnt seem to render the view at all. Is there some special way for drupal to put the cake view in or should it be seemless?

Thanks

jejk’s picture

subscribe

thijsje’s picture

Thanks for the port to Drupal 6 for Drake - it's very useful to me.

When using Drake on a test enviroment, i did run into an issue however. I installed Drupal on a sub folder ('www.blabla.com/sub/') and experienced the following behaviour. When accessing 'www.blabla.com/sub/drake?run=mytestcontroller', i did get nice CakePHP output, but the URL's in the HTML were not translated correctly. For instance, i got:
img src="/sub/cakephp/sub/img/cake.power.gif". Clearly, the second 'sub' is causing the problem.

Did anybody else experience this also?
I was unable to solve the problem with configuration. Could it be that Drake was developed and tested with the assumption in mind that Drupal will reside in the wwwroot (being accessable on 'www.blabla.com/')? If so, then attached an slightly modified version of 'cake_embedded_displacher.class.php' which will solve this. (I started using rowlandm's post 47). Hope this is useful to others.

thijsje’s picture

StatusFileSize
new4.23 KB
ericbieller’s picture

Title: Is Drake for Drupal 6 planed? » Is Drake for Drupal 6 planned?

Thanks a lot for putting this together! Ran into a problem when trying to implement the #47 code above on cakephp 1.3. I've got the exact code above in my controller file and the component seems to be loading. However I am getting the following error when running /drake " Fatal error: Call to undefined method Drake::redirect() in /sites/all/cakephp/app/app_controller.php on line 10". Not really sure why this would happen as the component is being loaded. Any thoughts? Is there something I'm missing? Thanks!

rowlandm’s picture

Hey guys,

Sorry - but I haven't touched Drupal and Cake for over 3 months now in my new job. I can't even remember how to implement it off the top of my head.

What I can say is I was running the CakePHP application like this:

http://book.cakephp.org/view/34/Production

I must admit I didn't test it any other way.

Hope that helps - although I don't think it does.

emackn’s picture

guessing this is pretty much dead. someone tell me different.

kenorb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 5 and Drupal 6 is no longer officially supported. If you think this issue is still relevant for 8.x, feel free to re-open.