CakePHP Digest #19 - The Holy Shit Do I Have A Ton Of Links Edition

Posted by Matt on Mon, Aug 17 2009

Seriously, could you guys please stop posting so many interesting blog posts and useful code? I'm having trouble keeping up.

News

CakePHP 1.2.4.8284 and CakePHP 1.3-dev Released

The Cake Team launched two new versions last week at some point prior to me getting around to publishing this. The first is a bug fix release for the 1.2 edition, which closed over 70 issues. Also the first development release of 1.3 was announced. There is a migration guide if you want to port a 1.2 app over.

One of the changes for 1.3 states:

DboSource::query() now throws warnings for un-handled model methods, instead of trying to run them as queries. This means, people starting transactions improperly via the $this->Model->begin() syntax will need to update their code so that it accesses the model's DataSource object directly.

I'm guilty of this, but mostly because I thought there actually were begin/commit/rollback methods. Here's a quick tip to fix this for 1.2 and 1.3 apps. In your AppModel:

function begin() {
  return $this->getDataSource()->begin($this);
}

function commit() {
  return $this->getDataSource()->commit($this);
}

function rollback() {
  return $this->getDataSource()->rollback($this);
}

Nate Gets Around

Lots of interviews with Nate Abele, Lead Dev of CakePHP (well 2, but one of them was 2 parts so it was really more like 2.5 interviews). The first was with Felix and is posted on debuggable.com. The second was with me and is posted on this site in two parts.

CakeMatsuri Tokyo

If your in Japan on October 30 to the 31 check out CakeMatsuri - a two day conference/workshop. Note that the workshops are "friendly", which means you means you can leave your weaponry at home. You will need your guns for...

Start Cleaning Your Pistola

@ZendCon announced that the closing keynote for ZendCon would be a framework shootout. Participating will be Matthew Weier O'Phinney, David Zülke, Fabien Potencier, Edward Finkler, and Nate Abele. Here's the description from their site:

Representatives from five major frameworks will form a panel on the stage and discuss the various pros and cons of their frameworks. Discussions will be moderated by Eli White from Zend and will include some history of why each framework has made various decisions over time. Audience participation will be encouraged and questions will be taken. Frameworks represented will be: Zend Framework, Symfony, Cake, CodeIgnitor, and Agavi

Bake Updates For Cake 1.3

Mark Story has a great post covering all the new updates and features for Bake in 1.3. Be sure to check it out. My favorite part: "Test cases also generate skeleton test methods for every non-inherited public method in your classes". Cool.

Another Free CakePHP E-book

Although he took some heat in the Google Group for not releasing the book in English, I applaud Azril Nazli on his free CakePHP E-book, Ebook Panduan Bina Blog Guna CakePHP versi 0.1. Here's my review: I can't understand a word, but damn does it look pretty. I'm like 75% jealous of how much better his looks then mine.

CakePHP Session at the Next PHPMelb Meeting

If you're live around Melbourne, Aus you should check out the next PHPMelb meeting: "Baking with CakePHP and Beginners Series Planning Session". It takes place on Monday, Aug 17, which may already be past...Aus is like a week ahead of the US in timezones, right? note to self: time based jokes only work if you can get the post out on time.

Anti-CakePHP Tweet of the Week

This is a new feature, where I pick out my favorite anti-CakePHP tweets(s). This one comes from @sjmadsen:

If the CakePHP and SimpleTest web sites/documentation were indicative of all PHP developers, it'd be safe to say they're illiterate.

Tickets and Commits

This is probably the last time I'll be linking to tickets over at the trac with the move to code.cakephp.org. And it could be the last time I link to tickets at all, unless code.cakephp.org adds a ticket RSS feed. I know, I know the code is open source - I should just add the feature and see if the Cake Team will include it TheChaw/code.cakephp.org isn't open sourced...not sure why I thought it was. See the comment below from Mark Story on using the timeline feed.

Convenience Functions

I thought this one was interesting. It covers removing the convenience functions (like e(), ife(), am()...) in basics.php from the core. Don't worry, though, it looks like they'll still be available, for the 1.2-1.3 branches at least.

Id...That is all

This one was kind of fun too.

In The Groups

Remove PHP 5.3 Deprecation Warnings

If you're trying to run the 1.2 branch on PHP 5.3 you may get a bunch of deprecation warnings. Here's a quick tip (which involves a core hack) to get rid of them.

In The Blogs

Teknoid has a post of how to build CakePHP shells.

Nate comes out of blogging retirement to post some secrets on admin routing.

Miles J has a post on plurals w/ Cake's l10n and i18n.

Ronny Vindenes posts a tutorial on how to integrate SlickMap CSS into your Cake app to get pretty sitemaps.

Code

From Miles J: a Feed Aggregator Component

From @markgandolfo: a Cycle CSS helper to alternate table row colors similar to how Rails does it.

@savant is converting all his CakePHP code to plugins including his GitHub plugin plugin, which provides an easy way to install plugins from GitHub.

From @utoxin: a behavior to automatically encrypt and decrypt a DB field.

From Nick Baker: A PayPal IPN plugin

From pointlessjon: an awesome fixturize plugin. I use this one and highly recommend.

From Graham Weldon: An automatic JavaScript includer helper

In The Wild

Just a ton of new sites since the last digest...
From @d4z0: feelv4.com - a Euro Honda site.

From @smalltowneye: smalltowneyes.com - a community site that integrated the "eye" part of the domain name just a tad too much into the design.

From Nik Chankov: linxspy.com - a service to make sure that any link exchanges are maintained. The service is free, for a small fee you can have Nik visit the homes of people who pull your links and remind them not to fuck with your page rank.

From @gerhardsletten: www.gersh.no - a new homepage.

From @gaslamp: adamwes.com - a math and science tutoring site. You know how ads for escort services always show really hot dudes/chicks, but when the person arrives they have 300 pounds stuffed into an outfit for a 125 pound person? Uhh...at least that's what I've heard from people... Anyway, all the "tutors" in the slideshow on the homepage are attractive and fit (you could say model-esq), but your tutor is probably caring a bucket of wings when they arrive. Who would have thought that escort services and math/science tutors services would have something in common?

Via email - SimcoeDining.com - a food/fun site fort the Barrie and the Simcoe-County area. If you read the URL fast it looks like sim coed ining.

I'm Out!

And on that note don't forget to subscribe to my feed or follow me on twitter.

As always if you think I missed something leave a comment. Or if you do something interesting and want it included in the next digest, send me an email.

Posted in CakePHP

9 Comments

Nik Chankov said on Aug 18, 2009
Haha, nice idea about linxspy for home visitation. I should add it as service :)
WyriHaximus said on Aug 18, 2009
Just gave it a try and it works great.

Also the sitemap looks cool gonne try and see how it works under big menu structures :).
Jose Diaz-Gonzalez said on Aug 18, 2009
@WyriHaximus You can see a slightly larger result at http://watertaxibeach.com/sitemap . This site is also built in CakePHP. You'd cry if you read the code powering it :P
Graham Weldon said on Aug 18, 2009
There is an upcoming talk "Introduction to CakePHP" at the SydPHP (Sydney) group on the first week of September. http://sydphp.org

Thanks for the JS Helper mention, Matt. Cheers :-)
Mark Story said on Aug 18, 2009
There is a timeline rss feed http://code.cakephp.org/timeline.rss. Thanks for the mention again :)
Matt said on Aug 18, 2009
Yea, I saw that. I discounted it because it was more then just the bugs, but now that I look closer even the other stuff is useful. I guess I could run it through pipes if I just wanted the bugs. Thanks.
Brendon Kozlowski said on Aug 18, 2009
I really should have finished up my McryptBehavior and released it, it's got so much more functionality...I just need to figure out how to run related models through the behavior if they too are using it; I can't think of an efficient means to do it. None of the current behaviors take that in to account.

SlickMap CSS looks awesome! I wonder if a SVG/Canvas implementation might be more cross-browser compatible though.

Thanks for reminding me about Miles J's site; I thought I added his site to my RSS reader, guess not.
Andreas said on Aug 18, 2009
If you want to have a look at a different cycle-Helper implementation:
http://functino.com/2009/07/cakephp-cycle-helper-alternating-row-colors-with-cake/

There are some difference to markgandolfo's. For example you can pass in a name for the cycle so you can use it in nested loops. It's also more flexible... but markgandolfo's is shorter.
Gerhard Sletten said on Aug 19, 2009
Thanks for mention my new Cakephp site! Love your updates!