PHP Developer / Blog

10 more tips to make your PHP application scream - Part 2 of N

Digg this article · Save to del.icio.us · Stumble it!

The previous article in this series talked about how to set PHP up so that it’s a lean mean processing machine. Now we get to make sure that our PHP code follows suit.

Also read part 1 of this article.

I’ll cover 10 lesser known PHP functions or methods that can help streamline your PHP code. Read the rest of this entry »

10 tips to make your PHP application scream - Part 1 of N

Digg this article · Save to del.icio.us · Stumble it!

I’ll be the first to state that there is no shortcut to making your PHP applications scream. This series aims to break it down into several steps. The first step will be taking a look at the PHP configuration on the server. We’ll be focusing specifically on PHP this article as a later article will cover 3rd party software which are an essential part of scaling your applications. Comments and suggestions welcome!

Also read part 2 of this article.

PHP.ini, getting your hands dirty
Almost all of the PHP configuration options are available in your php.ini file. PHP ships with several defaults which are suited for compatibility and not for performance. Let’s change that! It’s important to understand your application and what you can and cannot change. In some cases you might want to have allow_url_fopen = On even though I would generally recommend against it. Keep that in mind when reading this list. Read the rest of this entry »

Speed up Apache - how I went from F to A in YSlow

Digg this article · Save to del.icio.us · Stumble it!

I decided to embark on figuring out how to make my site as fast as possible. There were a few tips I was already aware of but decided to grade myself using YSlow. My initial score was bad, an F. I realized I had to do a few things.

  • Compress text/* files using gzip
  • Decrease HTTP requests by combining multiple JavaScript (and CSS) files into single files
  • Add aggressive caching since the site isn’t updated very often (especially images, JavaScript and CSS files)

Here’s what my original scores looked like. Read the rest of this entry »

Have prototype.js automatically eval JSON responses

Digg this article · Save to del.icio.us · Stumble it!

JSON is the perfect format for passing data from a server to JavaScript. With the prototype.js the JSON string sent by the server is automatically evaluated to a native JavaScript datatype. In order to do this you need to pass the data back with a content-type of application/json.

Step 1
First we’ll need to set up a script (PHP in this case) on the server to return a JSON string and specify the content type. This is easily done using the following code: Read the rest of this entry »

Eliminate paging results by using JavaScript (ala DZone)

Digg this article · Save to del.icio.us · Stumble it!

I noticed that DZone had a really cool UI for a list of user submitted links. DZone is similar to Digg but geared more towards programmers. The premise is that a small subset of links are populated when the page loads. Once the user begins to scroll and nears the bottom of the list it automatically populates more stories to the end. This is a great alternative to having numerous pages that the user has to click through. You can also view a working example. Read the rest of this entry »

The smallest PHP framework you shouldn’t code without

Digg this article · Save to del.icio.us · Stumble it!

This step by step guide will help you get set up with EpiCode (documentation) in under 15 minutes. EpiCode is a framework that maps URLs to static methods. It also has a few utility functions to make templating completely painless. There’s no new templating syntax to learn since PHP does a great job at that already. EpiCode also handles variable scope so you don’t have to worry about mucking up the global namespace. Read the rest of this entry »

Solving “connection failure” for YUI’s asyncRequest

Digg this article · Save to del.icio.us · Stumble it!

Earlier today I was receiving a failure response when using YUI’s YAHOO.util.Connection.asyncRequest method to make an ajax call. The YUI documentation on this doesn’t help too much when troubleshooting the problem so we need to figure out what the heck is going on. Read the rest of this entry »

Closures - Demystifying Javascript’s secret weapon

Digg this article · Save to del.icio.us · Stumble it!

Per Wikipedia, a closure is defined as “a function that is evaluated in an environment containing one or more bound variables“.

What’s a closure look like? Read the rest of this entry »


About this site:
This is my (Jaisen Mathai) personal site for potential employers who want to see my resume or portfolio. My ideal job would be to work as a PHP developer on a large scale consumer website. My experience is in using PHP, MySQL, Ajax and JSON. I really enjoy creative brainstorming...taking a problem apart and narrowing 100 solutions down to the best one.

Thanks for stopping by. Be sure to drop me a line.