Category: PHP

7 Areas Of PHP You Might Want To Optimize

October 16th, 2009 in PHP, Tutorial | 20 Comments

PHP is undoubtedly one of the preferred development methods chosen by many to create dynamic web pages. As contents get bigger, there is a real need to manage our PHP codes so that it runs faster. Unfortunately for many beginners, designers and enthusiasts, making PHP codes run faster requires intricate knowledge of the overall infrastructure around PHP. It could be your Apache settings, your operating system, or even the memory of your machine.

But we can start from somewhere. Here are 7 areas of your own PHP code that you can modify for performance.

PHP static Keyword

Usage of the static keyword on functions is often programmer’s first choice for optimization. It allows methods within a PHP class to be accessed without the need to instantiate it.

<?php
class Foo {
public static function staticMethod() {
// put codes here
}
}
Foo::staticMethod();
?>

The process of instantiating an object is always expensive and as we can see here, the function staticMethod() can be called without creating a new Foo object. This optimization could lead almost up to 4 times speed improvement.
(more…)

12 Free And Open Source PHP Forum Scripts

October 12th, 2009 in PHP, Resources | 39 Comments

Forum is a great place where people can have discussions and postings. Generally, a forum is a community with lots of user inputs and needs moderators to moderate the posts.

If you want to setup your own forum, you can go for either open source forum scripts or commercial forum scripts such as Invision Power Board. Should you choose a commercial forum script or open source forum script? It is depends on your requirements and also you or your forum’s administrator experience.

Today, we are going to share 12 Free And Open Source PHP Forum Scripts where you can easily build your forum and online community with them.

1. phpBB

phpBB is the most popular and wide-used open source PHP forum script. It has an easy to use administrator control panel and takes only few minutes to install. phpBB is very customizable, you can easily create your own themes and modifications to the script. If you face any problem with phpBB, you can always refer to the documentation.
phpBB

(more…)

Extremely Simple Way To Display Delicious Counts For Wordpress Users

September 3rd, 2009 in PHP, Tutorial, Wordpress | 13 Comments

Delicious is the most popular social bookmarking service. If you pay attention on WDB, then you may notice that most of WDB’s articles are being saved more than 100 times by Delicious users.

There are a lot of ways for you to display your Delicious saved counts. But today we are going to show you how to use Delicious API together with Wordpress custom field to save and display the Delicious saved counts.

What you need to know before start writing the code?

  1. MD5 – You need the URL’s Md5 hash value in order to lookup its Delicious saved counts. You can read more by reading the PHP md5() function.
  2. serialize() and unserialize(). We will need to serialize the data before storing to the database, and then unserialize them after retrieve from database.
  3. Custom field. We use the custom field to store the Delicious saved counts to the database. By saving the Delicious saved counts to the database, we can reduce the number of calls to Delicious’s API and also drastically speed up your post loading speed. Imagine, if you have 1k visitors per hour, then you will have 1000 requests sent to Delicious per hour. So, we have to save the counts in our database in order to reduce our server load too.
  4. (more…)

20 Promising Open Source PHP Content Management Systems(CMS)

June 30th, 2009 in PHP, Resources | 124 Comments

Content Management System, or CMS is an application used to manage news easily so that users can publish, edit and delete articles from the back-end admin system. HTML and other scripting language are not necessary to operate a CMS, though having them will add more advantages.

Since we had looked into 22 open source PHP frameworks, i decided to do a roundup of 20 Open Source PHP Content Management Systems so that readers who don’t have strong PHP knowledge can easily create their website using free and open source CMS.

1. Wordpress

Wordpress is a powerful yet easy to use content management system. Initially it was designed as a blogging platform. However, it slowly become popular and can be customized into a powerful CMS with some tricks and plugins. I had wrote an article about Wordpress SEO plugins and also talked about things that you should know about Wordpress 2.8.
wordpress

2. Drupal

Drupal is a free and open source modular framework and Content Management System (CMS) written in PHP. It is used as a back-end system for many different types of websites, ranging from small personal blogs to large corporate and political sites.
drupal

(more…)

22 Open Source PHP Frameworks To Shorten Your Development Time

June 23rd, 2009 in PHP, Resources | 48 Comments

PHP is a widely used programming language for web development. Although there are a lot of alternative programming languages for web development such as ASP and Ruby, but PHP is still the most popular among them.

So, what makes PHP so popular? PHP is so popular because it is relatively easy to learn compare to other language. Furthermore, there are a lot of great tutorials for beginner to get started. Although there are a lot of resources for us, but coding a site from scratch is very tough. Luckily, there are a lot of reliable PHP Framework which can shorten the development time. These frameworks are supported by huge community and they are willing to help if you face any problems.

Without talking much, let’s start to look into these 22 open source PHP frameworks:

Most Promising Frameworks

1. Zend Framework

zend-framework
Zend Framework is an object oriented framework written in PHP 5. It is based on simplicity, corporate friendly license, and a rigorously tested agile codebase. The loosely coupled architecture also allow developers to use Zend components within other framework.

2. Symfony

symfony
Symfony is a PHP 5 framework which provides an architecture, components and tools for developers to build complex web applications faster. The official site provides a practical tutorial for Symfony beginner too.

(more…)