So many options. I want to have a development environment that
- is pleasant to use as an editor
- includes a syntax highlighter for several languages
- in particular, supports HTML, CSS, Javascript, PHP
- context sensitive help - gives me the documentation for functions I'm trying to use
- auto-completion of names of functions as I type
- has integrated source code control
- integrated solution for copying the programs to wherever they run from
- has a debugger which allows stepping through the running program and inspecting and setting values of variables
So, downloading Eclipse for PHP from eclipse.org and installing was straightforward. Worked both on my Mac and on a Windows XP machine. I stopped tinkering with the Windows version though.
I wanted "grown-up" source code control, which for some reason equates in my mind to Perforce rather than Subversion or CVS. Downloading Perforce and installing was very simple, it runs like a charm and its user interface is quite simple to use once you understand its basic terms (requires reading a few pages of their intro documents). Getting Perforce's eclipse plug-in was simple too. Installing it in to my Eclipse was also simple. Then I got stuck on something basic. It took me a couple of extra cycles to find Perforce's documentation on how to arrange the relationship between Perforce's workspace and Eclipse's workspace. Now that it's done and configured (Eclipse's must contain Perforce's), checking files in and out using Eclipse and without using the Perforce UI is a breeze.
I like Perforce's tools for visual comparison of versions of a file, but interestingly, Eclipse has a similar tool for the versions of a file it remembers in its memory (a very nifty trick, better than Notepad++'s also infinite undo memory because it remembers the save points and shows you a visual comparison). If I were thinking about setting up a business with many programmers, would I use Perforce? Not sure. It's a little pricey beyond the first couple of users (which are free). CVS while ancient works reasonably well. I've seen Subversion used in serious commercial applications, and it's of course popular in the Open Source world. I'm glad I made the effort with Perforce, but either CVS or its more modern successor SVN would be just fine.
After solving the source code problem I went on to find out how to FTP files without exiting Eclipse. This took a little research. In the end I found a plug-in from Aptana Software which does this well. However when I downloaded and installed it, I took everything else that Aptana makes. So my Eclipse is now carrying around a lot of Aptana in its belly, and there are cases where Aptana wants to let me know it wants to help me, e.g. when I want to edit a file with a suffix of .sql. I can turn the pesky thing off, but Aptana is beckoning that I check it out. Maybe I should.
Why did I care about ftp? Because that's how we were working - uploading our files to a Unix server that had Apache and PHP installed. So once ftp was figured out I discovered I don't care. My Mac (vanilla imac running OS 10.6 - Snow Leopard) has a pretty recent php installed on it (5.3.1) and Apache. I downloaded mysql, a very simple undertaking, installed it, and suddenly my desktop has everything on it. Ah yes, also downloaded and installed the most recent version of phpmyadmin and installed it. Setting it up is a little tricky in my opinion, there's a step where you have to issue some Unix commands from its command line. I'm comfortable with this but not everyone is.
Somewhere along the line I realized that Apple's PHP doesn't have an extension that phpmyadmin prefers having, which is the ability to encrypt some communications (it's called mcrypt). Getting it added to PHP required downloading a lot of source code (both libmcrypt and PHP itself) but installing just a little bit of it. And looking at the php.ini file for the first time - minor changed need to be made to add an extension. There's surprisingly little documentation about this anywhere, but there are some kind souls on the Internet that figured it out and explain all. Took me longer than expected to *follow* the instructions, I'm not good at following instructions. Once I forced myself to do so, it was trivial. And once that was done, I read phpmyadmin's documentation and discovered that I could have simply turned off the pesky warning message that prompted this whole voyage. But this wasn't a total loss by any means, I learned a few important things on the way.
There's a very powerful tool out there for working with MySQL, it's called mySQL Workbench. It has a combination of database management and database modeling features. A project I'm working on, in a very nascent state, is heavy on data and has many tables. The exact relationships are numerous and lend themselves to be described in database terms of "foreign keys". The workbench tool allows you to lay out all your tables in a diagram, that includes a visual representation of these relationships. And then it allows you to "Forward Engineer" your diagrams in to the database itself - it creates all the tables, indexes and whatever other database objects you modeled. It also knows how to "Reverse Engineer" a physical database in to a model diagram. Modeling tools that I'm familiar with from the commercial world are incredibly expensive. I was blown away by how powerful this tool is. Caveat: it has bugs and crashes now and then (it's not officially "released" yet). There are some older tools from the same source that are less functional but more stable. I'm sticking with this one (and saving frequently:-)
Yesterday I stopped and asked myself why I've been barreling down the Eclipse route, and googled the topic of free integrated development environments for PHP. The search yields an actual comparison which was helpful. It reminded me that the once-great company Sun, (founders of which are probably the reason I'm a computer guy in the first place) knows one or things about development too. Now they work for Oracle. And MySQL went with them to Oracle. So should I be looking at their "Netbeans"?
Yes. Downloaded. While I didn't follow their prescription of downloading a complete "MAMP" environment (Apache, MySQL and PHP for Macintosh), and instead added missing bits to the installation I already have (Apple's own installation of Apache and PHP, plus my installation of MySQL), what I ended up with seems to be complete. The missing bit, the reason I decided to look around, was a debugger. And what I've installed is "xdebug", an extension to PHP that can be talked to by Netbeans. Here incidentally the investment in understanding how to install mcrypt paid off because xdebug's installation instructions aren't great (understatement) and mcrypt's are relevant.
Netbeans is quite cool. I've invested a fraction of the time to learn it than I did with Eclipse but it seems simpler across the board. Eclipse also has some kind of interoperability with xdebug, I hope to figure that out next. Netbeans sort of works out of the box and is very satisfying as such. Oddly Perforce doesn't have a plug in for Netbeans, but does for a whole bunch of lesser used tools. Most people I know use Eclipse (because they are Java programmers and it's popular in that world). I'll have to make a decision soon.
And get off this tools tangent and back to the project I want to write.