• RSS
  • Email
  • Twitter

CakePHP Digest #23 - Moving Day

Posted by Matt on Tue, Jan 12 2010

News

Before We Get Going

I've accumulated a lot of links since the last digest (two months between posts will do that). As a result some links that would normally be included didn't make the cut.  The good news is you'll never know if your blog post/code snippet was cut, so don't feel bad.  Although if you posted something CakePHP related since Thanksgiving then you can assume I saw it.  And if it's not included then you can assume I didn't deem it worthwhile.  So maybe you should feel bad...

GitHub and Lighthouse

CakePHP development moved to GitHub (Yea!) and Lighthouse (Lightwhat?).  Plus new plugins (localized and datasources), which are already on version 0.2 (that puts them on target for 1.0 around Jan 2024).

Cake Prayer

Via @predominant: A CakePHP Prayer

New CakeDC

Cake's parent company CakeDC got a fancy new design (via @PhpNut).  Also you can support CakePHP by grabbing the new migrations plugin for a $15 "donation".

New Default CSS

@mark_story posted a couple screenshots of what could be the new default style sheet.  HAWT!

Sites

validcake.com

I actually don't think this a Cake site, but it does generate the validation array for Cake models. 

checkoutmygarage.net

From @modethirteen: checkoutmygarage.net - Yes, it is pretty much what you would think it is: A site for uploading pics of your garage.  I might post some shots of my garage - boxes of old baby cloths/toys piled on unused exercise equipment.  Although I don't think that's what they're going for.

vegasorange.com

From @mgiglesias: A site for Vegas real estate.  I used to love Vegas, but haven't been in years.  I hear it's kind of lame now and Montreal is the hip gambling spot.  Hey, speaking of Canada...

harbourstation.ca

From @???? (I got this from twitter, but didn't note who posted it.  I suck): A Canadian arena that hosts Canada's two most popular forms of entertainment: hockey and Gordon Lightfoot. I'll leave it as an exercise to the reader to determine which is the most popular.

iqlink.com.au

From @predominant: iqlink.com.au - A product info site for sweet looking ATM that dispenses documents instead of cash (or something like that).

In The Blogs

Loading Helpers As Needed

Jeremy Burns has a great tip on how to load a helper for a specific action rather then the whole controller. This is nothing new, but it's worth mentioning again.

Better Zip Code Validation

Jamie Nay posted a short validation routine for handling various international postal codes.  This is mostly for 1.2 as the localized plugin mentioned above handles these in 1.3.

Bye-bye $cakeDebug

Teknoid has a post marking then of the $cakeDebug variable and some bits on how the new system works.

Code

Fixture Factory

I'm going to screw up the description on this one, but here we go: Fixture Factory is a CakePHP plugin for programatically creating fixture at the top of your unit tests, rather then relying on database records or _fixture files.

CakePHP to LI3 Bridge

This is more of a LI3 plugin for porting Cake apps bit by bit.  Here's the official descprition:

The li3_cake plugin allows you to develop applications that use CakePHP and Lithium together, leveraging classes and exposing resources using both frameworks in unison.

Be honest: you threw up a bit in your mouth reading that.  That description is a "synergy" away from qualifying for the enterprisey buzzword hall of fame.

Trees

If you're into trees then last month must have been like Christmas for you.  Also if you're into Christmas, then last month must have been like Christmas for you.  First we have Neil Crookes TreeCounterCacheBehavior plugin.  If you're smart you're probably asking:

@AD7six: why have a (total)child_count field at all. no-of-children = (rght - lft -1)/2 .

And obviously the answer is:

@neilcrookes: ah, I remember now, it's for when I add scope functionality

@neilcrookes: when I say remember, I mean, that's the excuse I just came up with for being too dumb to realise no-of-children = (rght - lft -1)/2

Also from Jamie Nay is his post "Adding Better Scope Limiting to CakePHP 1.2’s Tree Behavior".  One more: BTree Behavior from jas osborne, which claims to be faster then the Cake Tree Behavior when dealing with overgrown trees.

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 | 14 Comments

WordPress To Croogo Migration

Posted by Matt on Mon, Jan 11 2010

I'd been wanting to dump WordPress for awhile. I'm extremely neutral on WordPress in general, but two things drove me nuts:

1) It took me way to long to make simple changes to themes or plugins. Probably my own fault, since I don't really know the WordPress API. But I hated dealing with any of the related code.

2) I had to choose between slow or crashy. I'm on the smallest SliceHost VM - which is generally fine for the dozen other sites that share it. But the two WordPress blogs felt so much slower. I tried the Super Cache plugin, which would bring down all the php-cgi processes randomly when running in "full" mode. Mostly this happened when I was composing a new post (something w/ the auto-save), but other times just randomly in the middle of the night. I was doing all that retarded shit to work around it, like running scripts in cron to check if the site was up and then restarting if need. I hate that.  I spent three hours rocking back and forth in the shower the day I turned that cron on.

What's Croogo?

Croogo is CakePHP CMS built by Fahad Ibnay Heylaal (@fahad19).  It is currently at version 1.2 (although I'm running trunk with no problems).  The full feature list is available on the wiki and their are a bunch of screenshots on Flickr. 

Why Croogo?

Because it's CakePHP based and it was released when I was at my most frustrated with WordPress. I'm really that easy.  I wanted something Cake based so it would be easy to tweak. Plus it uses Cake's theme, which I already know, so I was able to convert the old WordPress theme (with a few updates) in about 5 minutes. Also this allows me to eventually take all the (neglected) code running on sandbox.pseudocoder.com and move it here. I had been running the subdomain to keep Cake and WordPress separate.

How To Do It

It's actually not that hard...since I did all the work for you :)

1) Install Croogo following the instructions.

2) Head over to GitHub and grab the Bye WordPress plugin.  Follow the instructions.  I moved about 200 posts and 1000 comments for this site.  If you ever left a comment here please check to make sure it made it successfully.  Thanks.

3) Create a theme (or use the default one or the one theme that's been released)

There's Always a Catch

Ok, so it isn't quite that easy. Here's some things to watch out for.

1) Database character encoding.  I had some weird issues with angled quotes and em dash's. I never really sorted them out - I just fixed in the final database manually.

2) Manually copy uploads. The Bye WordPress plugin will move the DB records for the attachments, but not the actual attachments themselves. Just copy everything in /wp-content/uploads to /app/webroot/uploads. Croogo doesn't support sub directories in uploads the moment, but it works fine with the sub directory structure that you'll be taking from your WordPress install.

Note: WordPress references images by their full url including domain in your posts, so if you're doing the migration on a beta site (as you should) you'll still see broken images until you actually switch the domain over.

3) Spam protection. Croogo comes with Akismet support built in, but it isn't enough to set your API key (Admin -> Settings -> Service). You also need to turn it on for blog posts (Content -> Content types -> Blog -> Comments).

URLs

You'll probably want to maintain your old URLs. Thanks to Cake's routing this isn't hard. Here's a couple I used:

/archives/this-is-a-post-title

CroogoRouter::connect('/archives/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'blog'));

/2010/01/this-is-a-post-title

CroogoRouter::connect('/:year/:month/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'blog'), array('year' => '[12][0-9]{3}', 'month' => '0[1-9]|1[012]'));

/2010/01/11/this-is-a-post-title

CroogoRouter::connect('/archives/:year/:month/:day/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'blog'), array('year' => '[12][0-9]{3}', 'month' => '0[1-9]|1[012]', 'day' => '0[1-9]|[12][0-9]|3[01]'));

/page-title

CroogoRouter::connect('/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'page'), array('slug' => '[\w\n\-]+'));

Note: It's important where in /app/config/routes.php you put these lines. If a URL maps to multiple routes it will use the first one in the file. So put these all at the top or at least the top of the section they apply to.

More Note: routes.php is included in the Croogo package, so if you do an update you could lose these changes.

Make It Fast

I updated my HTML Cache plugin so that it's Croogo compatible.  It generates static HTML files for pages, which are super fast to load.  Go ahead - refresh this page.  Bam!  Done!  The idea is basically the same as the SuperCache plugin for WordPress...except it doesn't crash the server.  I'll be adding that feature in a future version.

Mini Review

All thumbs up so far.  And since I decided to replace all the fingers on one hand with thumbs (thumbs are awesome!) that's like 6 thumbs up.  The docs are bit sparse, but if you're familar with Cake you should be able to dig in the code to figure stuff out.  Likewise the admin isn't as slick as WordPress', but it's certainly functional.  All the basic functionality you'd want for a blog is there - maybe missing some polish, but certainly working.

Wrap

I'd definitely recommend making the switch if you're frustrated with WordPress and would rather deal with a Cake based platform.  Plus it will give you something to blog about if it's been over a month since your last post.


Posted in CakePHP | 22 Comments

CakePHP Digest #22 - Don't Go Away Mad...Just Go Away

Posted by Matt on Mon, Nov 23 2009

News

CakeFest IV - Somewhere, America

The Cake team is looking for suggestions for the next CakeFest, which will take place somewhere in the U.S.A. I vote for my backyard. There's a 50/50 chance I could actually make it then.

addons.mozilla.org dumping CakePHP

The most trafficked CakePHP site has announced plans to switch to the PHP framework Django. Wait, Django is only for Python? So they're not only switching frameworks, but re-coding the whole site? They must have some real issues with CakePHP 1.2 and 1.3 to be making such a drastic change. Oh, they're still running 1.1? Don't you at least take a shot at upgrading before making such a major change? That's like switching to Snow Puppy from Vista without even trying Win7. That's right Cake is Windows in this scenario. Anyone have a problem with that?

Once addons.mozilla.org is gone (also xplodsony.com is gone too), what will be the largest Cake site in terms of visits/pageviews? Post your site with average monthly visits and pageviews in the comments. Winner will get a prominent mention in the next digest, plus a feature in a future digest when it inevitably moves to Django.

CakePHP 1.3 Alpha

CakePHP 1.3 looks pretty awesome. If I had a high traffic site that cataloged addons for a popular internet browser, that was still running 1.1, I would think about upgrading to this version. Just tossing that out there.

In The Wild

blackbooksingles.com

Hmmm...blackbooksingles.com (announced via their twitter account) is free online dating site built with CakePHP. Sound familiar?

hardwoodinfo.com

From @nezencreation: The American Hardwood Information Center. If you still find boner jokes funny (and who doesn't!), go to the homepage and read the rotating flash part and pretend all the text is about THAT kind of hardwood. My favorite: "Nature's Brilliance Has Created A Magnificent Material - Eco-Friendly, Durably, Asthetically[sic] Pleasing". I can neither confirm nor deny that this kept for entertained for a solid ten minutes.

andrw.net

A Croogo powered blog from @andruu: andrw.net and damn is it sweet looking. I have to be careful and not say too much nice stuff or WordPress will get jealous and take down my server.

In The Blogs

Ajax Pagination in 1.3

Mark Story has a post showing how to do Ajax pagination with Mootools in CakePHP 1.3. Although it seems like it would be just as easy to do with any of the other supported JavaScript frameworks. We could be seeing this in our favorite browser addons catalog in a matter of days if they didn't need to switch the entire underlying framework and coding language first. Instead it'll be roughly 2012 before they're back to 50% of the functionality they have now.

Routing Explained

If you've read the Cookbook entry and the "Secrets of Admin Routing" article and still don't get it, now we also have "Routing Explained". No more routing articles. I'm putting my foot down. Unless you still really, really don't get it. Then you get one more. But that's it. And then right to bed for you.

Get rid of .htaccess

Ryan Pendergast has a nice article on the bakery showing to speed up your Cake site by moving the mod_rewrite rules that are in your .htaccess file to Apache's config. Another speed up tip: Remove Apache, along with your .htaccess files and install Nginx.

Code

Archivable Behavior

Sohaib Muneer release a new Archivable Behavior. It's kind of like some of the "Soft Deletable" behaviors that are floating around, expect instead of flagging the row in the database it moved it to another table, so that the original table doesn't get too cluttered. I like to call this "The Table of Misfit Rows".

Searchable Plugin

This one is from Neil Crookes. It's a plugin for doing site searches, without having to rely on a search engine. I haven't had a chance to play with it yet, but I have no doubt it's completely awesome.

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 | 14 Comments

CakePHP Digest #21 - Whose Left?

Posted by Matt on Fri, Oct 23 2009

News

So Long and Thanks For All The Gwoo-Abele

Ok, maybe it'll be easier this way: Everyone NOT leaving the CakePHP dev team please take a step forward. First it was Gwoo who left and then Nate soon after. And now I'm hearing rumors that the "C" is leaving and it'll just be "akePHP". In all seriousness, this is all slightly worrisome for Cake developers (I'll take the liberty of speaking for everyone single one of you here). We're talking about the people listed second and third on the Cake contributors page. How can there not be some anxiousness? The Cake team could kill any doubt about the future of the project with a Bakery article. Here's a template:

Hey Cake Community,
I'm sure some of you have seen the news that Nate and Garrett have left the project. First off, we'd like to thank them for their awesome work over the past few years...(continue lavishing praise. You could stick 6 paragraphs here and you'd barely be scratching the surface). We wish them both the best in their future endeavors. (also note: no parting shots. Whatever disagreement (if any) took place behind the scenes - keep it that way).

Looking forward, we still have some great developers as part of the team. Mark Story is kicking so much ass leading version 1.3. We also have xxxx leading version 2.0 and making great progress. Just last week 2.0 achieved consciousness and now repeatedly asks: "shall we play a game?" They grow up so fast...

You get the picture: 1) praise, 2) restore confidence.

I'd also like to take a moment to personally thank Garrett Woodworth and Nate Abele. I'm sure no one on the outside can truly recognize all the work they've put into the project. Everyone pause and pour1out for your homies. On the bright side we still have Cake and now Garrett and Nate are off to do whatever they have planned next. So basically it's like having conjoined twins who are now separated (probably not the best analogy, but I'm sticking with it).

Updated API and Book...now with more ads!

The Book and API got updated (momentarily dragging the stagnant @cakephp twitter account away from it's beach side chair to make the announcement). AdWords are now showing up for the three of you who don't ad block. My favorite so far is from the Security lib, which was something like "Want to become a security guard?". I was pretty tempted for a moment. Do I get a baton or just a really long flash light that doubles as a weapon? Also there are plenty of Java ads, which are a nice reminder for when you're having a bad day: it could be so much worse.

In The Wild

fontstruct.fontshop.com

This one came in via email. It's a pretty cool looking font creator. I'm not a huge font/typeface nut. The whole legal aspect has always turned me off. So many patents and trademarks and who can use what type and how it can be rendered. Seriously we're talking about fucking letters here. I also once used comic sans in a site design, so basically I have no credibility here.

paularmstrongdesigns.com

New homepage for Paul Armstrong, announced via twitter.

free-bingo-cards.com

A site to make free custom printable bingo cards. Suspiciously hosted on the same IP as this blog.

In The Blogs

Unit Testing CakePHP Shells

I stupidly missed this one in the last digest, proving once again that I shouldn't blog sober.

Top 10 things to look forward to in CakePHP 1.3

Teknoid has a great post counting down some of the changes to CakePHP 1.3. Go ahead and read it right now if you haven't already. Ok, now tell me you're not excited for 1.3.

Anti-CakePHP Tweet(s) I enjoyed

From @alibby:

Feeling marginal about CakePHP. I wonder if there's any other way to feel about it.

From @alexmbarton:

The white screen of death is fantastic fun on a Saturday evening. Thanks #cakephp, we really appreciate it

Code

Google Analytics

Neil Crookes rocks it once again with his Google Analytics plugin.

Croogo - A CMS

From @fahad19: Croogo, a CakePHP powered CMS.

I'm Out!

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 | 32 Comments

CakePHP Digest #20 - Nothing Left To Bitch About

Posted by Matt on Thu, Sep 24 2009

News

CakePHP 1.2.5

We bitched about PHP4 support and result sets as arrays and Cake3 was announced. We bitched about being stuck with prototype/script.aculo.us and CakePHP 1.3 was announced. We bitched about deprecation messages with PHP 5.3 and CakePHP 1.2.5 was released. Is there anything left to complain about?

Version Confusion

How about how confusing it is that there are so many different CakePHP versions? Can we complain about that? Oh...I guess not.

München Workshops

Fine, what about the lack of CakePHP workshops in München during 15. und 16. Oktober 2009? How dare the CakePHP not fix this incredibly glaring oversight. Shoot...that one is covered too.

CakeMatsuri

Ha, that was trick. I didn't really care about German workshops. What I really want is a CakeFest like gathering in Tokyo, Japan on October 30th and 31st and I want it to be called CakeMatsuri and I want workshops all day on the 30th and talks all day on the 31st and I want lectures from Garrett J Woodworth, Graham Weldon and Joel Perras. Why doesn't the Cake team ever listen to my demands the needs of the community???

Anti-CakePHP Tweet(s) of the Week Month

From @robertbasic:

for fucks sake #cakephp you're one fucked up framework. I hate you from the bottom of my soul

My demand for @cakephp to respond went un-answered. Again CakePHP not coming through for it's users.

I will donate $5 to @cakephp if they reply to this tweet with "We hate you too". http://twitter.com/robertbasic/statuses/3602590128

This one from @s_bergmann got re-tweeted a lot. Of course, I lost all respect for the tweet once I looked up "dementor" and found it was a Harry Potter reference.

Reading the CakePHP source code feels like being kissed by a dementor.

In The Wild

Nothing? Really? I must have missed something, right? Can the CakePHP team get on this right away?

In The Blogs

URL Shortener

Jotlab has a post on going from clean install to working URL shortener in 8 simple pages.

Code

Cupcake Forum

Miles Johnson has released an awesome CakePHP forum plugin. This thing rocks pretty hard - you should definitely try it out before wasting your time trying to integrate some other forum system.

File Uploads

Upload plugins are now giving Twitter components/datasources a run for most released CakePHP code. Here's UploadPack from @szajbus, which was recently made into a plugin.

OpenID Component

There is a new version of cakebaker's OpenID Component.

Akismet API Component

Seth Cardoza released Akismet API Component for fighting spam. This would probably be better off as a datasource, but I can see why people stay away from datasources since there aren't any docs for it. Oh wait, what's that? The Cookbook now has a datasource section? Fuck...one less thing to complain about I guess.

Static Pages

Not much in the way of docs on this one, but if you follow this link path you'll figure it out - I have faith in you. First check out Jonathan Snook's original post and his updated post. That should help you understand AD7six's latest version. Code has now been "verbosified" (great word, courtesy of @AD7six).

Lorem Ipsum Helper

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pulvinar, est ut convallis vestibulum, lectus velit placerat lorem, sit amet euismod erat nunc sit amet enim. Cras dictum aliquet mauris vitae elementum. Morbi scelerisque enim ac turpis interdum pellentesque ac at eros. Ut quis leo libero, a sagittis sapien. Proin molestie neque ac quam tincidunt mattis. Ut magna urna, posuere quis rhoncus et, laoreet vel erat.

Simple Queue Plugin

MSeven released a simple job queue plugin. It doesn't require any additional server configuration so it's an easy way to get up and running with deferred job execution. As a semi-professional slacker, you stick the word "deferred" in front of anything and I'm interested.

Session Handling

ADmad has a post showing how to customize CakePHP's session handling.

I'm Out!

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 | 7 Comments
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10

Tags

  • Startup
  • Satire
  • Code
  • CakePHP

Popular Posts

My Sites

  • PlanbookEdu.com
  • RSStalker.com
  • Later.RSStalker.com

My CakePHP Plugins

  • Asset (JS/CSS) Packager
  • Custom Find Types
  • Html Cache
  • JavaScript Validation
  • Site Status Page
  • Static User
Copyright © 2012 PseudoCoder.com, All Rights Reserved.
Powered by Croogo, Built with CakePHP