This article is part of my #100DaysOfCode and #100DaysOfBlogging challenge. R1D12


With a working CLI PHP version switcher, it would be very neat to also have a CLI PHP version manager, which allows the automated installation of available PHP versions. As an inspiration I am looking with one eye toward the nvm. I am aware of the phpvm package. This package provided by Anthony Ferrara is far from stable and currently supports only Ubuntu. My focus will be the Windows platform.

Functionality

Some commands that come in handy.

  • list to list (by pvm) locally installed PHP versions
  • list-remote to list all available PHP versions
  • install <version> to install given PHP version
  • use <version> to switch to given PHP version
  • uninstall <version> to uninstall given PHP version

Retrieve available PHP versions

In order for this project to even work, I need to be able to fetch a list of available PHP versions. On windows.php.net/download the current releases are listed. Parsing that HTML is not too sexy. So, I am looking for anything else like a RSS feed or so. At first glance I cannot find anything. As I have a closer look on the download links, I notice there is a directory listing available for releases, archives and “latest”. The HTML does not look very strict. The capital tags remind me on how HTML used to be written ages ago. But that would work.

Just to make sure I don’t miss any other options, I’m pinging Pierre Joye - Development Team Leader.

Next

Each PHP version is currently offered for x86 and x64 system versions with each a thread safe and non-thread safe version. For now, I would only offer the x64 thread safe option, to go with Apache and PHP running as module. x86 versions should work similar and probably could be added pretty easily. However, I am not sure why one would want to use them anymore.