Tutorials

PEAR and other fruit

Sunday, January 27th, 2008

And for all the PHP nerds out there, here’s a brief intro on PEAR.

There’s a lot of talk right now about PEAR and how it helps PHP development. So as a result there’s a lot of folks trying to figure out how to get PEAR set up. It’s important to keep in mind that PEAR is just a repository for PHP packages. It’s the packages you want. PEAR is simply a way to download and manage the packages. If you’ve got PHP > 4.3 installed, you’ve probably already got PEAR installed as well. Trying going to the command line and running pear -V. If you get anything besides command not found, then you’ve got PEAR installed.

So once you have PEAR installed, you can download packages by doing the following:

pear install <package name>

This will download the desired package into the extension directory. The extension directory can be changed in the pear.conf file, but it’s usually right in your home directory: ~/pear/lib.

Once you have the desired packages dowloaded, you’ll need to tell your scripts how to access them. PHP is a parsed language, so extensions are simply included in your main scripts. You can include the package files manually, using the full path. For example, if you wanted to include the DB package:

include("/Users/jdoe/pear/lib/php/DB.php");

You could also set PHP’s include_path setting. The following does the same thing:

ini_set("include_path", ".:/Users/jdoe/pear/lib/php");
include("DB.php");

If you’re including more than a single package, the include_path option is cleaner and more elegant.

An update on Owen

Friday, June 29th, 2007



Afternoon playtime

Originally uploaded by williambarry007

Owen is now 10 months old. In the past few weeks he’s been getting much more mobile. He’ll pull himself up to a standing position using whatever is close, then he’ll walk around using his hands for stability.

And two days ago he took his first two steps!

Joshua David Moyer

Friday, June 29th, 2007



IMG 0303

Originally uploaded by williambarry007

Congratulations to Marty and Jenna Moyer on their new son!

Creating an image that repeats

Saturday, May 5th, 2007

Often, you’ll be creating a template for a website and you run into a situation where your image isn’t large enough to cover the area you need covered. Or you might want to create a greater sense of volume by having a nice image repeat in the background of your header. Whatever your reason, here’s an easy way to do it.

Step 1

Find an image that you want to repeat.
Step 1

Step 2

Split the image down the middle.
Step 2

Step 3

Swap the sides of the image. This is done so you know that the outer edges will meet properly.
Step 3

Step 4

Photoshop the middle of the image. This just takes practice. I find that the clone tool works great here.
Step 4

Finished

Once you’re done, you just set the background of an element to repeat the image you just created, and this is your final product.

Off the IV

Wednesday, August 9th, 2006

The doctors swapped Amy from an IV to an oral medication last night at 6 pm. So far, it seems to be working just like the IV med, but without the cumbersome IV tree following Amy all the time. Amy is feeling well. She’s had a few minor contractions throughout last night and one today, but they’ve all been very minor and completely isolated. When they start coming in waves, then the baby’s coming.