Introduction
Before I even start, let me state that I’m a JQuery fan. Ever since I’ve started with JavaScript frameworks I’ve weighed the pros and cons, and trust me there are a lot. You’ll always find people arguing Prototype, JQuery or MooTools. I went with JQuery because it could do all that I wanted with the least amount of bloat. I’m sorry, Prototype may do a hell of a lot, but I don’t think that I could make enough use or that 100 KB to justify it. Plus, Prototype can’t even handle basics on its own without having to piggy back off of script.aculo.us and it’s effects library.
Speed
Now with every new version of a Framework that comes out, this argument comes up again and again. Finally, we have something to put the arguments to rest.

In my personal testing, I’ve found that JQuery 1.21 leads the pack, but only in Internet Explorer. In Firefox it comes in dead last. Does this discourage me? Maybe a lil’ bit. Am I going to stop using JQuery and switch to Prototype? I think not.
Posted in JavaScript.
Tagged with Ajax, browser, firefox, ie, JavaScript, jquery, mootools, prototype.
By Kevin Lloyd
– January 28, 2008
This is the second installment of my Auth Component Tutorial. I included a link to download a file for during the first installment:
CakePHP Auth 1 (4.3 KiB, 7,704 hits)
I just think that some of the stuff in there warrants some explanation.
isAuthorized()
This function is needed when $this-Auth->authorize = ‘controller’. Theory has it, you can do something similar in app_model if $this-Auth->authorize = ‘model’, but I haven’t looked into this.
The thing that confused me about this is that I thought you were required to perform your own validation. But oh no, this is additional authorization. Sort of like what beforeSave() does, where you can cancel the save after the validation. isAuthorized() is performed after the user has been logged in. If after that, you need some additional stuff, then you can put it in there. I’m not sure why it doesn’t default to return true like beforeSave() (if everything goes well), but if it’s not present, it errors out.
$this->Auth->user(’group_id’)
In my User Model I have a field called group_id. So you guessed it, this just returns the group_id of the user that’s logged in. Things couldn’t be simpler.
Posted in CakePHP.
Tagged with auth, CakePHP, PHP, tutorial.
By Kevin Lloyd
– January 11, 2008
First off, I would like to say much thanks to Gwoo for finally helping me to understand this thing.
So I know what you’re thinking; I’m probably the last person to finally figure out the CakePHP’s Auth Component. For the past few months, I’ve been using obAuth because that’s the only authentication I could get to work with CakePHP. I think that I was just making it more difficult than it should have been.
My main resource for learning the Auth Component has been Chris’s tutorial, but even then I still needed help. Also, I’m the type that doesn’t really learn much without code.
Note that I’m running off of the CaekPHP 1.2 beta.
Getting Started
Now you can modify this however you like, but I’m starting out with the basics. You’re going to need the following:
- A user database with fields username, password. Of course they don’t need to be named that way, but defaults are fun.
- A User Model with Controller and Views - This can be baked from CakePHP
- A login view for the user.
- And a base app_controller.php. That’s it.
The Setup - app_controller and users_controller
So here’s the minimum in app_controller:
Posted in CakePHP.
Tagged with auth, CakePHP, PHP, tutorial.
By Kevin Lloyd
– January 8, 2008
So I guess the CakePHP development staff doesn’t take any holidays. Bright and early New Years Day 2008, we’re greeted with a fresh new release of CakePHP 1.2.6331 beta. No, not pre-beta a full blown beta. Needless to say I’m excited about this.
There have been some nice changes which have gone through all through the Christmas season. Guys, I thank you for your dedication. The one major thing I’m excited about is the way that the Form Helper now processes dates and times; there’s no longer a cleanUpFields() function, everything is automatic (or should I say automagic). You’ll have modify your code since the result in $this->data is slightly different. There’s been some stuff deprecated and some stuff added.
The Model::generateList() function has also be deprecated, in favor of Model::find(’list’). It’s not an exact duplicate of generateList() but it gets the job done. Check out the cakebaker for more essential tips for upgrading from CakePHP 1.2 pre-beta to the fresh new CakePHP 1.2 beta.
Enjoy and Happy Baking!
Posted in CakePHP.
Tagged with bakery, CakePHP, form, PHP, upgrade.
By Kevin Lloyd
– January 7, 2008
I can’t remember where exactly I heard about this web host, but InsaneGB.com sounded like a great deal. You can read their website for more details, but in a nutshell they got PHP 5, MySQL 4, and everything (Databases, Add-on domains, etc) is unlimited except disk space and bandwidth. They give you 5GB for disk space and 20GB on bandwidth per month. Which is great for a free host, if you ask me; heck, they even offer cron jobs.
Testing Their Setup
So I decided to give them a shot. I put up my personal blog on their server. In retrospect, maybe that wasn’t such a great idea, but I did it anyway. At first everything was great. Stuff was fast and everything was popping up instantly. There were some things that most would consider acceptable for a free host.
-
I couldn’t run any PHP ini_set commands
So there’s no increasing running time for scripts. I guess I would live without that.
-
You can’t open/download any files from outside servers
This I came across when trying to use some of my Wordpress plugins that automatically install plugins and automatically upgrade the Wordpress installation. Oh, well.
Posted in General.
Tagged with cron, database, free, MySQL, PHP, web hosting.
By Kevin Lloyd
– January 2, 2008
One problem that I’ve always had with finding CakePHP related information over the internet is the multiple sources. I wouldn’t so much mind if all these sources were legit. The thing that pisses me off is those scrapers who scrape the entire CakePHP mailing list. To me, there’s nothing worse than asking a question in the mailing list, then searching on Google for an answer, just to find some idiot has scraped your question from the mailing list. I try to report them when I can, but I just can’t seem to keep up.
Sorry for the rant, back to my point. Sharan over on the CakePHP mailing list has made the process of finding the latest CakePHP information a lil’ bit easier. Using Yahoo Pipes, he’s taken feeds the most popular CakePHP RSS feeds and consolidated them into one giant feed - http://feeds.feedburner.com/cakephp. The great thing is that he’s also taken some of the non-english blog feeds and slapped on some translation. What more could you want?
I’m not sure how much the author values his privacy, so if you want to get in contact with him and/or view the Yahoo Pipes source for this feed, head over to the CakePHP mailing list and search for: “http://pipes.yahoo.com/sharanbrar/cakephp”. If you think that their’s a blog missing, just leave a comment here and I’ll route it to the author.
Posted in CakePHP.
Tagged with CakePHP.
By Kevin Lloyd
– January 1, 2008
After reading about Matt’s Experience with the Zend Framework, I came to the conclusion that one’s choice of a Web Development Framework doesn’t really matter. There are tons of frameworks out there and there’s a good reason for that. People still use them. If no one used a framework it would die a quick and painless death. Different frameworks offer different benefits to different people.
However, I’m willing to bet that First Choice is one of the main factors affecting a developer’s choice of framework. I fell into CakePHP first because I had an initial choice of CakePHP and Code Igniter. I couldn’t quite get CI working quickly enough, so I jumped on CakePHP and I’ve been here ever since.
Something else which solidifies the First Choice method is that the frameworks are sufficiently different that there is a learning curve when moving from one to the other. If you’ve started using one framework effectively, learning another (even to discover potential benefits) is usually not worth the time.
So I say this to you; be confident in your choice of a web development framework. Code Igniter, CakePHP, Symphony, even Ruby on Rails, it doesn’t matter and no one cares as long as you can crank out functional web applications in a reasonable amount of time.
Posted in PHP.
By Kevin Lloyd
– December 31, 2007
One thing that I liked about the jQuery website is that they offer a compressed version of the jQuery script on the website ready for immediate download and usage. This is convenient if you don’t want to go through the few steps it takes to Minify your own javascript code.
Well we now have this same luxury for Prototype and its Script.aculo.us library read for download.
Enjoy folks.
Posted in JavaScript.
By Kevin Lloyd
– December 29, 2007
Recent Comments