PHP

Drupal Performance Tuning

I am currently working on a project using Drupal 5.1 for a social networking site. Each page on the development site would take 3-9 seconds to load and on the production environment would take 2-7 seconds. Way too long. I was able to easily increase performance.

The context

Storing Socket in $_SESSION variable

It is not possible to store a socket connection in a session variable in order to keep it open. Instead, use the PHP function pfsockopen to open a socket connection and leave it opened between web requests. This function only allow the connection to be persistent when you are not using CGI mode or running the script as a CLI script.

However, the pfsockopen function does not allow you to keep track of the socket on a per user basis. It will simply return you the one that was opened previously.

PHP Multi-threading project (server-client application)

PHP was built to be a web scripting language. It is not meant to be multi-threading as the web servers it runs on already handles the multi-threading and the server-client aspect. If you are thinking about working on a PHP project which involves multi-threading and server-client architecture, think about using the web server to handle that and using HTTP protocol.

I would recommend using another language (C, C++ or Java for example) to build a server-client application.

Now offering online voice consultation with Skype Prime!

I have been using Skype for some time now. I just registered to Skype Prime which allow me to charge a per minute or per call fee for consultation. If you need an expert's opinion on something about PHP, click here: http://www.skype.com/go/joinskypeprime?call&skypename=christian.s.roy

Re-using serialized PHP data

A friend of mine stumbled across the PHP function serialize() and thought it was pretty cool. It is pretty cool indeed. He was wondering how that can be used in a real example and how to extract/retrieve that serialize data later on.

Good Challenge: Symfony Askeet Tutorial

There's a reason for the challenge. The Symfony project offers a tutorial modeled after the advent calendar: 1 exercise per day for 24 days (24 days before Christmas). It suggest that each exercise should take about one hour (average). Some of them were quite simple and they took me 15 minutes. However, some of them took me 3 to 4 hours. The reason: The tutorial was written using version 0.6.x and I am using 0.7.x. There are a number of fundamental changes between the two series. Some instructions refer to files or functions that do not exists.

PHP5 Framework: Symfony

A French firm have developed what seem to be a very powerful and and yet very flexible framework for PHP. It's PHP5 only and the videos which demonstrate how Symfony works reminds me of what I saw on Ruby On Rails. I have reviewed a number of PHP framework and this one really seem to offer the greatest flexibility. I will give it a try.
http://www.symfony-project.com/

Oh, Smarty!

Smarty is more popular than I thought. I wish I had learned about it sooner. The powers of plugins is just great! I worked on a few projects that I've found on RentACoder and a few of them were using Smarty. I think it's a great template engine. You should really consider it!
http://smarty.php.net/

DB_DataObject_FormBuilder

If you need rapid prototyping, this is one of the absolute must. It will build a n HTML_QuickForm object which allow you to quickly access your database tables using forms. I am using it in my web framework that I am develping to be used for our various in-house projects we are going to be developping.
Documentation on the form builder can be found here:
http://opensource.21st.de/11.html

Payment_Process

I've found a Unified payment processor for e-commerce solutions. It's still in Beta and only support about 5 payment gateway, but the core principale is sound. I've already started working on a ChasePaymentech driver as a contribution to the Payment_Process PEAR package.
http://pear.php.net/package/Payment_Process

Syndicate content