As I post more and more code here, I’m finding it tedious to update all the various .zip files of code as I make changes. So I’ve taken a page from Tim and Felix and made an account at gitHub. This makes it easy for me and you to find the newest revision of whatever you may be looking for.
In my previous Auth and Acl tutorial I mentioned that I wasn’t including a way for users ARO to be automatically updated when a User’s group was updated. Well ‘hepper’ posted a patch to the AclBehavior
in the comments to that article.
The documentation for CakePHP has grown in leaps and bounds since the creation of the cookbook. Today I wanted to look at a few methods and conventions that may not be crystal clear from reading the book or api.
Object::_set().
Object is the parent class for almost all other classes in CakePHP.
With all the talk of testing going on, I thought it would be good to look at how tests work and what is makes them tick. SimpleTest handles the bulk of test case execution, however, there are a few CakePHP specifics that are not part of a normal SimpleTest::UnitTestCase
.
When bakers first start using CakePHP there is a tendency to use requestAction()
more often than it should be. Often requestAction()
gets used to pull in common elements like recent posts or new comments, or to make menus. This makes sense in a way as it keeps the comments code in the CommentsController
and all is well.
Often on IRC and the CakePHP google group, I hear people asking how to get values out of the Session or how to find out what is currently in the Session. Generally this is connected to AuthComponent, which is can be complicated component. However, some simple ‘crude’ PHP tactics can make the “whats’s in my session?” question very simple.
Continuing in my previous vein of ACL related topics. I’ve got another handy addition to the ACL user’s toolbox.
Websites need maintenance, and sometimes that maintenance requires the site to go down for a little bit as you tweak the database, add additional capacity or make large changes to the application code. In these circumstances you cannot afford to have users mucking about on your application. However, you might need access to ensure all your amazing upgrades go smoothly or perhaps do the upgrading inside the application itself.
If you are looking for part one go here
In the last article we created the basic models, controllers and views for our Auth and Acl controlled app as well as initialized the Acl tables. We also bound our groups and users to the Acl through the use of the AclBehavior
.
Now, there are many tutorials out there for Auth and ACL in CakePHP. However, none of them (as far as I know of) cover putting together Auth and ACL from beginning to end. That is what I’m going to do in this article. I am splitting the article into two parts; the first about setting up our app and getting the Aros running, the second on building Acos and putting it all together.
As webservices grow so does the need for being able to communicate with them in an easy fashion. This simple blog alone uses 2 webservices. The recent tracks at the bottom is a feed I pull from Last.fm and my spam protection is provided by Akismet. When first building my site I looked for an already built solution and found a partial solution in Felix Geisendörfer’s WebModel.
Well I just got back from a wonderful 2 week vacation of europe. My wife and I went to Amsterdam, Rome and Paris, for an art-geekout. We went to every museum we could and saw tons of beautiful works that really need to be seen in the stone and paint. We took tons of photos and I hopefully will find the time to do some painting based on them in the upcoming months.
Well today I took the time to upgrade to CakePHP 1.2 RC1 in the spirit of ‘eating your own dogfood’. I got the usual warnings about vendor()
being deprecated. I also took the time to switch over all my Bindable calls to the fresh core Containable Behavior. Which for the most part consisted of changing restrict()
calls to contain()
calls.
Earlier this week I learned that isset()
behaves a little differently than I had expected when dealing with arrays. Now I already knew that isset()
would return false on a variable not existing, or being set to null. However, I was not expecting it to return false on an array key existing and being set to null.
I was recently asked to join the development team at CakePHP a position I graciously and excitedly accepted. And although I’m still a bit wet behind the ears, I thought I would share some of my experiences in how you can get involved with Open Source Software.
Indicating to the user which fields are required is something that increases usuability, helping the user fill out the form more effectively and efficiently. These visual cues have absolutely nothing to do with the structure of the document, and would best be handled by CSS.
Super fresh in the SVN builds of CakePHP 1.2 is the new code coverage analysis. If you are living on the bleeding edge of cake development or just want a preview of the neat things to come once 1.2 is complete read on.
The guys at debuggable have contributed a fantastic tool to the testing suite for CakePHP 1.2.
CakePHP 1.2 is a fantastic improvement over 1.1. However like many, my work has a stable release only policy. So I’m stuck using 1.1 at work for the time being. But after drinking the 1.2 juice, 1.1 is missing some of the potent automagic flavours. First up editing multiple rows in models. The stock syntax is lacking in that it doesn’t support this at all.