In my Beyond Frameworks talk, I explained how a component-based architecture can help answer some of the important (i.e. expensive!) questions you might face when creating long-lived apps that rely on a PHP framework. In this series of blog posts, I’m going to look at how to go about creating and working with components.
We’ve created a development tool, called phix, to make it as easy as possible to create and maintain your own components written in PHP. Apple OSX users might want to follow these instructions for setting up PHP et al on OS X 10.7 Lion first, before installing phix.
We assume that you’ve installed Xcode (which is free from the Mac Store)!
Using The One-Line Installer
The easiest way to get phix installed onto your shiny Macbook Air or Macbook Pro is to run the following command from a Terminal window:
curl -O http://phix-project.org/installers/osx-10.7.sh ; sudo bash osx-10.7.sh
This command downloads a simple shell script (which you can find on GitHub if you want to read it before trying it!), which is then run as the user “root”. The shell script:
- Makes sure that you have a suitable version of PHP installed
- Upgrades the PEAR installer to the latest version
- Uses the PECL command to install additional PHP extensions (this is what you need Xcode for!)
- Installs the package phix/phix4componentdev, plus dependencies, from the PEAR channel pear.phix-project.org
If all goes well, once everything has finished, run the following command and you’ll see that phix is now installed:
$ pear list -c phix | grep phix phix 0.13.2 stable phix4componentdev 0.13.2 stable
Where To Find The Latest Installation Instructions
You can always find the latest installation instructions for phix on the Phix project’s website, including full instructions on how to do a manual install if you have trouble with our one-line installer.