Thursday, April 5, 2012

Chapter 7 Exercises: A Slow Start

First let me say that I was unable to actually get to the exercises, mainly because of the difficulties that I encountered installing the SimpleTest plugin for Eclipse.  On that count I was ultimately successful.  Here follows the painful account of the experience.

The version of RMH Homebase that was used on previous exercises was the 1.5 version, and the version needed for the new database exercises is the 2.0 version.  What this meant was that I needed to start from scratch as far as getting a new development sandbox ready.  Going back to Scott's awesome instructions for doing this made the process a lot less of a headache.  The switch over from 1.5 to 2.0 involved the following steps:
  1. Downloading the new 2.0 code and placing the rmh20 folder into my /var/www folder
  2. Creating a new MySQL database in phpMyAdmin named rmh20DB
  3. Setting up myself with security privileges in the new database
  4. Entering these privileges into the dbinfo.php file in my webroot folder
  5. Adding the project to Eclipse
  6. Running (as a web page) dbinstall.php then dbinstallsandbox.php in Eclipse to set up the sandbox
At this point I figured that I was in the home stretch and would only have to quickly install the SimpleTest plugin.  This turned out to be a bit more complicated.  Some of these instructions were extremely helpful in the installation, but my old version of Eclipse made things impossible.  More on that later...here is the process:

  1. Download the tarball here for the Eclipse plugin
  2. Extract in whatever folder you downloaded into
  3. Open up Eclipse and go into Help > Install new software. Enter the following url into the "work with" box > http://simpletest.org/eclipse/ and then click add. 
A this point, a checkbox should come up that says "Uncatagorized", which you check and then run through the rest of the steps.  For me, because of my old buggy version of Eclipse, this didn't happen.  Thinking the problem was me, I ran through the steps a few more times and then succumbed to sweet rage and frustration for an hour or so.  After finally calming down, I realized that I needed to update Eclipse to the newest version.  I ran the update and everything went smoothly from this point on.  The final steps are thus:
  1.  After installing the plugin, its time to configure.  Restart Eclipse
  2. Go into Window > Preferences > Simpletest
  3. Enter the executable location for php (mine is /usr/bin/php5), the php.ini location (mine is /etc/php5/cli/php.ini/), and the path to where the extracted Simpletest folder is.  Then put down the file extension as .php
  4. Now go into Run > Run Configuration.  Highlight Simpletest and then click on 'New' (tiny box at top left).  
  5. Enter into the form that pops up a name for your new configuration, the project (rmh20), and then the test file (alltests.php).  Save it and you are ready to test.
After all of this I now stand ready to complete the exercises over the weekend.  Wish me luck.

No comments:

Post a Comment