Skip to content


Stop Hating On PHP And Learn To Code Better

So here we have the timely battle that PHP faces. Frankly, I’m getting sick and tired of this. All in all, I’d have to agree with Jeff on this one, to a certain extent.

They Say PHP Sucks

You’ll hear the same claims every single time: “Google PHP Sucks you’ll see how much PHP sucks”. Oh please! This is some of what the haters usually use for the argument:

  • There are too many functions
  • PHP Isn’t OOP
  • Everything is strung together - This claim usually talks about the interaction between PHP and/or SQL

In Defense of PHP

The number one claim is that everything in PHP feels like it’s clunky and may fall apart at any time. Granted, I’ll be the first to admit that I hate boring SQL queries. Keyword here is boring. Within the past year, I’ve really gotten to see that SQL has a lot of power. Learning of all of awesome power, just makes me hate writing crap like:

select title, body, post_date from posts where id = 32

Functions, Functions, Functions

I, myself, have never really understood the “too many functions” argument. Maybe it does make the documentation a bit muggy to get through, but how many functions that are in there have very little to do with me. I don’t care, I just use a handful of them.

Posted in General.

Tagged with , .


Bindable Behavior Now In CakePHP Core

It’s not news that Bindable Behavior has saved countless lives in terms of functionality.

As of Changeset 6918 this has now been integrated into the CakePHP core. So, we’ll have something to look forward to in the official release of CakePHP 1.2. Mind you, there may be a lot of other hidden gems in there, I just haven’t been paying attention lately :).

Most of the functionality is as we remember, with a few exceptions:

  • $this->Article->restrict(’Comment’) now becomes
    $this->Article->contain(’Comment’)
  • $this->Article->find(’all’, array(’restrict’ => array(’User’))); turns into
    $this->Article->find(’all’, array(’contain’ => array(’User’)));

For a complete list of the differences and changes you can check out the
Containable Test Cases for excellent examples of how to use this to it’s full potential.

Posted in General.


Qualtiy Website Design - 3HN Designs Review

So, you’ve been reading this blog for a while and you’re (hopefully) picking up very valuable tips on website and web application design. But just like all other do-it-yourself (DIY) projects, no amount of tips or tutorials in isolation is going to make you an expert. So you throw your hands up in say “I’m done with this web design crap!” But, you still need a website. So what do you do?

[Shameless Plug]

Enter 3HN Designs.com

3HN Designs comprises of a group of, you guessed it, three (3) developers that have a common goal: to provide quality designs at an affordable price.

Services Provided include:

  • Website Design
  • Web Application Development
  • Logos
  • Search Engine Optimization
  • etc.

They offer static web design, along with a custom CMS approach and other forum, gallery, and shopping cart scripts.

Under The Hood

So what does the finished product comprise of? Well it depends on what you pay for. At the base price of $500.00, you’ll come away with a nice, fresh looking XHTML/CSS web site that you can mangle to your hearts content.

Posted in General, Resources.

Tagged with , .


Twitter to Bite the PHP Bullet?

One of the big things you’ll hear about Ruby on Rails is that it’s hard to scale. In my opinion, that’s not really an issue that one should be addressing on the framework level. Scaling, in my opinion, should be something reserved for backend databases and servers. From what I’ve read, you should be able to slap on a MySQL proxy and an Apache load balancer in front of multiple mongrel servers, but I digress.

With all the Twitter Rails scaling issues, it’s funny to see this headline from TechCrunch. Guys over at Twitter have renounced this claim though.

Will this make me abandon my quest for learning Ruby on Rails? I highly doubt it. Scaling becomes an issue on extremely high traffic sites. And a lot of the issues that come into play with such a high traffic site, can be easily remedied by things like optimizing queries and caching.

Source: Twitter Said To Be Abandoning Ruby on Rails [TechCrunch]

Posted in General.


Do We Not Understand What Bias Means?

Somehow I don’t think most people understood what my bias comparison of CakePHP vs Ruby on rails meant. The last few visitors to comments seem to have been Rails fans. One of them seems to think that I shouldn’t touch Ruby on Rails with a ten foot pole and should stick with CakePHP. He doesn’t want someone like me in their community. The other comment, I get the opposite vibe from. He strikes me as a PHP fan, who thinks I’m too lazy for the PHP community.

To all the folks that haven’t seem to understand my whole objective, let me help you guys out. I have general interests in a lot of areas and I also work a 9 to 5 job. So I don’t really have the time and dedication required to poor my heart and sole into everything that comes along. I do a brief overview of something before I spend tons of time delving into it. People are pissed that I’m comparing CakePHP to Ruby on Rails and haven’t even tried it yet. This is where the brief overview comes in; I took a quick look and realized that for what I was doing at the time, Ruby on Rails would have been more trouble that it was worth.

Posted in General.

Tagged with , , .


Wordpress 2.5 - The Vista of Blog Platforms

So it’s been about a weeks since it was out, so I figure, why not? After all I have the Wordpress Automatic Upgrade plugin, so this should be a breeze. Now this plugin makes upgrading Wordpress ridiculously simple. It handles file backups, database backups, deactivating and reactivating all plugins, etc.

So I go through the process and I’m not totally disappointed. There were the normal problems we have with all upgrades and some new ones:

  • Theme Issues: This only happened on one of my blogs. Heck, it’s an old theme, so that’s to be expected. The widgets didn’t quite work right, but it was fixable.
  • Plugin Issues: Of course there will be those. Some plugins haven’t been updated yet, some just required me to update them. And with the new plugin update feature, it was quite easy to fix these problems. Then, there are some plugins I just had to totally disable, but upgrades for these are coming out everyday. I’m down to one old plugin that hasn’t been updated yet.

Posted in Blog, General.

Tagged with , .


CakePHP Auth Component - Will You Remember Me Tomorrow?

This is the third installment of my Auth Component Tutorial. This tutorial builds on the first installment, so make sure you grab the download file:

Download: CakePHP Auth 1  CakePHP Auth 1 (4.3 KiB, 7,704 hits)


You’ll find it on almost every popular web site’s login page; a nice lil’ checkbox that says “Remember Me”. It seems to have become a basic addition to any page with a login form. Generally, when a user logs into a web site, he’s logged in until his session expires. Which usually translates to when they close the browser window or when they allow the session to timeout.

With a Remember Me cookie, you hit the lil’ checkbox and it stores a lil’ cookie on the user’s computer. This cookie can contain various information (we’ll get to that later) but it essentially enables the user to bypass the login process the next time he comes to the page requiring authentication.

So, the simplest way to proceed is to list changes by file, so strap in your seat belts, here goes.

The Obvious, The Login Form - login.ctp

Now of course you need to add the checkbox and a label for said checkbox. Simple enough:

Posted in General.

Tagged with , , , .


Yay! Wordpress 2.5. Almost Perfect

Now I don’t have to tell you guys about all the goodies that Wordpress 2.5 brings, but I’ll name a few anyways:

  • New fresh Admin theme
  • Nice Dashboard
  • You can modify the link for “Incoming Links”. Technorati anyone?
  • Finally included Tag Management
  • Concurrent Post Editing Protection
  • One Click Plugin upgrades. Oh yes. It’s about time.
  • Built in Gallery
  • Nice Flash Media Uploader

There’s just ONE thing that rubs me the wrong way.

They’ve gone an given the admin theme a fixed width layout, designed for a 1024px monitor. Why, Wordpress, why? This is really a pain, after I decided to get (not one, but) two 19″ Wide Screen LCD monitors. Luckily, there’s a plugin that puts things back into perspective.

Posted in General.

Tagged with , .