English

Debugging a Browser Redirect Loop

Hi all,

I am using CakePHP with the Auth and ACL components. My page loads fine for non-registered users, but if I try to log in as a registered user I get an infinite redirect loop in the browser.

I am sure that this is some sort of permissions problem, but the problem exists even for users who have permissions for everything. The only way to prevent this behavior is to allow '*' in my AppController's beforeFilter method.

What is the best way to debug this sort of problem?

Thanks!

How can I find all records for a model without doing a long list of "OR" conditions?

I'm having trouble composing a CakePHP find() which returns the records I'm looking for.

My associations go like this:

User ->(has many)-> Friends ,

User ->(has many)-> Posts

I'm trying to display a list of all a user's friends recent posts, in other words, list every post that was created by a friend of the current user logged in.

The only way I can think of doing this is by putting all the user's friends' user_ids in a big array, and then looping through each one, so that the find() call would look something like:

Problem in integrating Wordpress blog's in Cakephp Website

Hello Everyone,
I was working on a site of Cakephp which was successfully delivered.But recently Client again appered and asked me to put the Wordpress blog in it,to cover up the Blogging thing in his site.He wants to share the authentication between the Cakephp and WP.Whoever registers in his site,then Logins in it and if he clicks on the Blog Tab,he must be redirected to the WP blog with the session still there.After some googling I have installed it in /app/webroot/blog folder but I am not able to edit the .htaccess file.
Please help me in the right direction,that how to share the authentication betwenn Cake Php and Wordpress, and the second one how to customize the .htaccess file so that URL's look good.
Thanks in advance..!

OpenInviter for CakePHP

A few months ago, I've published a case study on the bakery about a website made with Cake.

http://bakery.cakephp.org/articles/view/unaneem-com-a-community-website-...

As I listed the components I used, i spoke of an OpenInviter component for CakePHP. A lot of people asked more informations about it.

The thing is that the OpenInviter tool evolves very fast (a new version every 2-3 days) so it's hard to disclose a stable CakePHP version component.

Whatever, I decided to disclose my current version and hope that the community will contribute to make it stable. So here it is...

Introducing VaM Cart

VaM Cart - Free, Open Source CakePHP Based Shopping Cart.

Official Site - http://vamcart.com/
Online Demo - http://vamcart.com/demo/

* Easy Installation.
* CSS, JS minify and compress.
* SEO - Search Engine Optimization.
* Unlimited Categories, Products.
* CakePHP, MVC, Smarty.
* Multi Language, Multi Currency.
* Templatable.
* Open Source.
* Automatic Image Resize.
* Product Reviews.
* Coupons...

Join Us.

Copyable Behavior

Copyable Behavior adds the ability to copy a model record, including all hasMany and hasAndBelongsToMany
associations. Copyable relies on Containable behavior, which this behavior will attach on the fly as needed. HABTM relationships are just duplicated in the join table, while hasMany and hasOne records are recursively copied as well.

The value of a simple release process

I’ve been doing many of the CakePHP releases, since “the great framework apocalypse of imminent doom”. Between then and now, CakePHP has had quite a few releases. During these past few months, I’ve really begun to understand the value of a simple release process. When I initially started doing releases for CakePHP, our release process involved many steps and I was doing them all manually.

Making CakePHP Templates in TextMate

I finally got around to exploring templates in the TextMate bundle editor. The PHP bundle does not have any templates, and so I set out to create a few to improve my workflow. I thought it would be helpful information for PHP developers using TextMate. I actually used the Ruby interpreter to power my templates, but you can definately use PHP, or any other interpreter you like (Python, Perl, etc.). You might want to check out Environment Variables in the TextMate manual.

For the impatient: download the bundle. You should go through this post and make sure you set up shell variables properly. They are useful and worth understanding.

Managing Memory on the Cheap

It’s not new that taking notes, writing and playing with data makes it easy to remember the subject in question. I remember that back on school time when instead of cheating on the tests I would just prepare the cheat sheet and by doing so I would fix the matter and end up not even needing to cheat at all.
Another example is post-it cards that allow taking quick notes and thus exercising the subject in question before even getting back to it. After writing in one, before sticking on the wall I already get it stuck in my mind. In both cases I ended up having a document to refer to when in need of some help to refresh my mind, but still I had it much clearer in my mind.
Here are some habits that help me get on track by creating stronger references in memory for things I need to keep in mind or would like to use in the future:

[CakePHP] Can not Bake table model, controller and view

I developed small CakePHP application, and now I want to add one more table (in fact, model/controller/view) into system, named notes. I had already created a table of course.

But when I run command cake bake model, I do not get table Notes on the list. I can add it manually, but after that I get some errors when running cake bake controller and cake bake view.

Can you give me some clue why I have those problems, and how to add that new model?

Making HABTM relationships unique in CakePHP

I have two models, called Book and Tag, which are in a HABTM relationship. I want a couple (book, tag) to be saved only once. In my models I have

var $hasAndBelongsToMany = array(
    'Tag' => array(
        'className' => 'Tag',
        'joinTable' => 'books_tags',
        'foreignKey' => 'book_id',
        'associationForeignKey' => 'tag_id',
        'unique' => true
    )
);

and viceversa, but the Unique flag does not help me; I can still save two times the same couple.

How do I do this in CakePHP? Should I declare the couple (book, tag) unique in the database directly, or will this make CakePHP go nuts? Is there a Cakey way to handle this situation?

EDIT: I tried making the couple unique with the query (I'm using MySQL)

New Versions: Uploader 2.5, Gears 2.0

I have been working on the following versions for over a month and deemed them worthy enough of release. Enjoy!Uploader v2.5http://www.milesj.me/resources/script/uploader-pluginhttp://github.com/milesj/uploader

cakephp error how to clear this error

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wp_generator' was given in

plugin.php on line 339

which cakephp relationship should be used for groups of users? can haveMany use array for foreign_ID?

In my tennis application, my 'match' table has two players (obviously). I've used player1_id and player2_id as a way to track the user ids. I haven't included a user_id foreign key though.

There is also a 'user' table where I want to pull player's names from.

Because 'match' has more than one user and users have more than one model, I'm wondering if the following model configuration will work:

I've setup the user model like this:

var $name = 'User';
var $hasMany = array(
'Match' => array(
'className' => 'Match',
'foreignKey' => array( 'player1_id', 'player2_id'),
'dependent' => true,
)

and the match model like this:

HABTM Data Corrupted During __saveMulti()?

I'm using Cake 1.2.6 and last night I noticed that a HABTM relationship wasn't being saved when I submit a form.

I have a HABTM relationship between Committee and Volunteer. The primary key for a Volunteer is a UUID while the primary key for a Committee is a human readable string (e.g. BOARDOFDIRECTORS, FAIRCOMMITTEE, FAIRASSOCIATES, etc.). I have a form to create/edit volunteers and that form includes a select box whose options are exactly what you'd expect and are populated with options returned from Cake's find( 'list' ) method. Although I can't think of a reason it would matter, only one committee can be selected for a volunteer (the HABTM is for expected future needs).

NINJAS!


A friend tipped us off that Abduzeedo had a Friday post on the Awesomeness of Ninjas, mentioning the article probably deserved a spot on the dojo blog. I couldn’t agree more.

Sharpening the Blades: Styling Forms, Problem with Passwords and HTML5 in IE9

This edition of Sharpening the Blades features an article from Mike about using jQuery, CSS and image sprites to create stylish forms, an article from Benjam about Passwords on the web and Mark chimes in with an article about the possibility of HTML5 in Internet Explorer 9.

What framework would allow for the largest coverage of freelance developers in the media/digital marketing sector

This question is not about which is the best, it is about which makes the most business sense to use as a company's platform of choice for ongoing freelance development.

I'm currently trying to decide what framework to move my company in regarding frameworks for web application work.

Options are

  1. ASP.NET MVC
  2. Django
  3. CakePHP/Symfony etc..
  4. Struts
  5. Pearl on Rails

Please feel free to add more to the discussion.

I currently work in ASP.NET MVC in my Spare time, and find it incredibly enjoyable to work with. It is my first experince with an MVC framework for the web, so I can't talk on the others.

The reason for not pushing this at the company is that I feel that there are not many developers in the Media/Marketing world who would work with this, so it may be hard to extend the team, or at least cost more.

Copyable Behavior for CakePHP 1.3: Recursive Record Copying

Until I switched to CakePHP, any CMS I built for a client had a “copy this item” tool. The Cake framework doesn’t have anything like that built in, so for the past year or so the new Cake-powered CMS I built for work hasn’t had any sort of ‘copy item’ ability. Recently, however, I needed the functionality, so I decided to write a behavior to handle it. And now I’m happy to release it to the community as Copyable Behavior.
Download Copyable Behavior on Github.
I’ve wrapped it in a plugin, since that seems to be the trend in the community these days (though I’m not sure why just downloading a behavior file is so bad).

The Future of the Web and Things Like That

Category: Tips & Random Tags: HTML5, Future, 3DAfter watching Jesse Schell's presentation on the future of gaming:

I'll summarize from memory in case you don't have time to watch it:

Syndicate content