Tag: PHP

Zen Coding

When I first heard of Zen Coding on Sitepoint, I figured it was some other gimmick that might save me about 0.01% of my time each year after I spend five or six hours learning the syntax.

Zen Coding works by expanding some abbreviations into properly closed html. The syntax is very simple, and can be easily explained in just a few examples. The syntax is basically CSS selectors which most web designers / web developers should already know.

Overall, I found installing and using Zen Coding to be very worthwhile. I just made sure to change the shortcut key in Notepad++ because Ctrl + E wasn’t doing it for me. 🙂

Ports exist for a lot of different editors, and IDEs, so check it out. What other productivity tools do you use?

PEAR Mail – Checking If Mail Sent

PEAR Mail & mail_mime is absolutely fantastic for sending multi-part mime emails and requires absolutely no effort. Probably, the best part of PEAR Mail & mail_mime is not having to deal with mime boundaries.

I often see incorrect code for handling whether the message successfully sent or not. To check if the message is sent we should do something like the following.

$isSent = $mail->send(...);
if (PEAR::isError($isSent)) {
// error handling goes here
} else {
// successfully sent code goes here.
}

If we simply use the following code, we’ll always have a true condition because $isSent won’t be set to null.

$isSent = $mail->send(...);
if ($isSent) {
// successfully sent code goes here.
//Unfortunately this will always be called
} else {
//code here will never actually be executed.
}

Hope this helps!

PHP Object/Variable Life Time

Many junior PHP developers seem to feel that PHP objects and variables are retained between requests. In PHP4 and PHP5, no variables are retained outside of the contents of $_SESSION and other stores between requests.

Continue reading

Learning Drupal

For the last couple of weeks, I have began playing around with Drupal because I’m so sick of fighting proprietary CMS. The proprietary CMS suffers from the vendor updating only updating the CMS when convenient for them and this ends up holding the purchaser hostage. Overall, I know that drupal has enough of the functionality that I need in modules and the core to significantly improve the efficiency of my programming and possibly offer a large learning opportunity on software architecture.

Continue reading

PHP Update Finally Depreciates PHP MSSQL driver

The biggest advantage of the change is being able to better take advantage of Microsoft SQL Server features that probably made you choose to use SQL Server in the first place.Making the change wasn’t overly difficult because I took time and wrote a simple Database Access Layer.

Continue reading

Open Source Week 2009

I am so excited to say that I finally booked everything I need to attend the Toronto Open Source Week. In a couple of weeks time, I will be spending a couple of days in Toronto while attending the many conferences, workshops and presentations on open source software (GNU Linux, PHP, etc.)

I am hoping to do some serious networking for my consulting business, along with getting more experience with web programming and the rest of the LAMP stack which seem to be creating an IT revolution.

I hope to see you at some of the events!