First off let’s briefly look at what MySQLi is.
PHP has always had a special relationship with the MySQL database, it is literally designed to work with MySQL and the two applications use this symbiosis to be a very effective web application platform. Over the last few years however MySQL has made some extraordinary progress in being a truly powerful, fully relational database. It has not always been this way, for a long time MySQL was kind of a rigged flat file system which was blazingly fast and could scale to pretty amazing proportions, considering the way it was put together, but it was not technically a relational database. Since v4.1 however MySQL has been the real deal, a good solid relational database. The downside to this progress is that the PHP MySQL Extension that allowed the two to work so well together has not really kept pace with MySQL’s progress. So PHP developers set about replacing the old MySQL extension with a new more robust one and as of PHP 5.5 PHP will require developers to use MySQLi to communicate with MySQL databases versions 4.1.3 and later. This is, from all that I have read and the discussions I’ve been in on, a good move. MySQLi is a more feature rich and arguably a more secure way to communicate with MySQL. There’s far more information on this than I can cover here, indeed entire books are being written on the topic, but suffice to say, this is the way PHP and MySQL are going, so better get on board.
That being said, the question to ask is, does Cartweaver 4 PHP use MySQLi and is it compatible with PHP 5.5? The answer is no, not right now, but yes it certainly will be, and it will be well before it becomes any kind of a problem for developers and Cartweaver users! Is the lack of MySQLi support a problem now? No. Remember there are millions of legacy PHP/MySQL applications already on the web and still in development that use the legacy PHP / MySQL extension, so this change, by the very nature of the web will happen slowly, but it will happen. As an example, there are an incredible number of web sites still being powered by traditional ASP, and even a few developers that are developing current sites in it – certainly NOT a course I’d recommend – even though vb-ASP has not been actively supported or updated for years! The point is with an order of magnitude more pre PHP 5.5 sites in use today, this is a situation that will change at a pretty glacial pace.
How will hosts handle this?
A good example would be to look at what many of them do now – for example look at HostGator: http://support.hostgator.com/articles/hosting-guide/hardware-software/what-version-of-php-are-you-using - Depending on the selected service, users can choose between PHP 5.2, 5.3 or 5.4 and before long they we will no doubt see PHP 5.5 showing up as a choice. Given that it was released just a few of weeks ago, it will be a while before it is installed on most servers.
So for the next year or so, or more, so long as users can choose to run PHP 5.4 or lower, the Current release of Cartweaver 4 PHP will run properly.
Does this mean we are going to sit back and wait? Certainly not! We are already at work on making the switch to MySQLi, we have worked really hard to make Cartweaver 4 a powerful robust ecommerce solution, so it makes perfect sense to be very pro-active in making the transition to a more robust database connection method. In brief here is what we are in the process of doing…
Step One: We are starting out by replacing the mysql directives with mysqli directives.
Basically, this is doing an application wide update of mysql_connect replace it with mysqli_connect , and mysql_query , replacing it with mysqli_query – there may be a few other commands to replace here and there and we will test as we go for stability and performance, but this will cover the first phase.
Is that it? Well it could be, this will get things working under PHP 5.5 so this is what we will do first. But we won’t stop there.
Step Two: Once the application is fully working under PHP 5.5 with the above changes we will then go through the application and see where we can take advantage of using parameter appending, instead of putting the parameters in the middle of the query. This among some other things MySQLi brings to the table is a better, and supposedly more secure, way to build queries, so over time we will replace the current query syntax with the MySQLi syntax, starting with areas where we may be able to see the best performance enhancements.
Naturally step two will take longer but this is where we will be going. The web is a constantly moving target and we fully intend on continuing to move with it.
Now to answer the inevitable next question; when will the update be available? Well PHP 5.5 was just released on June 20th, so seriously we have a little time here. The web community is pretty good about getting really worked up about things that won’t have a real-word impact for some time to come, so let’s take a moment to cool our jets here. But we will have Step one out in the near future, we know this is where PHP/MySQL are headed and we will stay ahead of the curve, this is as important to us as it is to you.
So the short answer is, we are all over it, and we will keep you informed of our progress and will let you know as soon as the initial MySQLi updated version is available. So stay tuned here, and be sure to follow us on Facebook, Twitter and on the Cartweaver community Forums.
If you have any questions please let me know I’ll be glad to answer them!