I am using Drupal and I changed the way the timezone field is used in the users table. It used to contain the number of seconds difference. For example when my timezone was EST (America/Montreal), then this field would have -18000 as the value.
-5 * 60 * 60 == -18000
Now, this field contains the actual timezone id (America/Montreal or EST). This is much more precise and support daylight savings.
Earlier this year (march 2007) I went to the PHP Quebec Conference in Montreal where I met Rasmus Lerdorf. He gave a very interesting presentation where he talked about various things, including something called calgrin, xdebug and cachegrind. It seemed very interesting but I did not have the opportunity to try it. Until recently that is, now that my project is in beta in terms of features and that we need to tune it to increase performance. I saw this post and it reminded me of these tools.
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.
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 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.
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
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.
I just started a new contract which involved Drupal 5.1 which I never worked with. I spent the week going over a number of CMS in order to decide which one will allow me to deliver the contract in the shortest time. My decision ended up being drupal 5.x series. I considered the Community, Learning curve, Resources (people who knows it in our area), Extensibility, Cost, Maturity, development Speed and Scalability.
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.
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.
Make a Payment to Christian Roy