Showing posts with label version control. Show all posts
Showing posts with label version control. Show all posts

Sunday, 9 May 2010

Bye-bye Symfony and Netbeans...

I can't believe that it's been almost six months since I last posted anything on this blog. How time flies when you are having fun!
A great deal has happened since my last post. Having written about the Symfony framework, I decided to abandon it after a few days, mainly because the documentation was somewhat lacking. Instead, I opted for the Zend Framework. After checking out a few online documents and buying a few books on OOP, I was away in next to no time.
I am running the latest version of the framework (1.10) on my development workstation and staging server and it is a very good development environment. Once a project is set up, it takes very little time to have a working website.
One area where it scores very highly is the creation of forms. The built-in validators for Zend_Form and Zend_Validate mean that it is easy to create a form which is fully validated when it is submitted to the server. Moreover, the forms should be more secure as there are validators to help stop XSS and SQL injection attacks.

On the subject of integrated development environments (IDEs), I decided to abandon Netbeans and go with Eclipse. There is nothing wrong with Netbeans per se, other than it ran very slowly on my workstation. Eclipse runs much more quickly and once I had got used to its user interface, I felt it was much better.
One thing that I really like is the way it integrates with my subversion server, so I can commit changes to the repository from Eclipse, without having to go into a separate shell. It saves time and encourages good practice.

All of this has meant that once we had agreed on the overall design, I have been able to make excellent progress with the website I am currently developing with a business associate. There is no doubt in my mind that the combination of an IDE like Eclipse and a programming framework like the Zend framework make a huge contribution to productivity and speed of delivery. That said, some of the modules in the framework can be a little hard to get going and it's often necessary to search the fora or google for solutions to problems. Overall though, it's definitely quicker than having to hand craft code.

Friday, 11 December 2009

Definitely good Karma!

My installation of Ubuntu 9.10, the Karmic Koala went without a hitch. Well, that's not strictly true, as I did have a few problems getting the BackupPC server to restore data onto my newly formatted and repartitioned hard drive.
It was a fairly simple fix though - I had forgotten to add a couple of parameters into my rsyncd.conf file: something that became apparent after a cup of strong coffee and a ponder.
Once the rsyncd.conf file was corrected, I was able to start moving data between the backuppc server and my workstation with surprising rapidity.

The main problem I had was restoring my mySQL databases. I had used mysqlhotcopy to create backup copies of the databases on the system. It took a couple of attempts to get the databases working, but I got there in the end.

The process I followed was:
  • log in to the mysql client and create the databases (create database {databasename})
  • stop the mysql server
  • when the databases have been created, copy the backed up files to /var/lib/mysql/{databasename}
  • As I copied the files over as root, I then needed to call chown mysql:mysql /var/lib/mysql/{databasename}/*
  • start the mysql server
  • log into the mysql client and check the databases were OK - a couple of describes and selects does the trick. It's pretty obvious when there's a problem
  • finally, test the web application(s) that use the databases.
As far as my website development projects were concerned, rather than use backuppc to restore them, I opted to use subversion to load them from the repository I set up last weekend.

So, apart from a couple of applications that I need to load and setting up rsync so it runs as a daemon, the system is fully functional.

My first impressions are of a system that loads really quickly. The new versions of OpenOffice.org now supports the latest .docx files, so it looks like it's fully compatible with the most recent versions of MS Office. That said, I haven't tried spreadsheets yet...

Overall, a good day's work. Time for another coffee and a surf to find out more about PHP development frameworks!

Saturday, 5 December 2009

Version Control

Now that I have almost finished developing the back-end code for David Pentland's website, it has become increasingly clear that some form of version control system is no longer a "nice to have". Having created many new php files (and edited even more), keeping track of all of the changes has been a bit of a challenge. Moreover, I am just about to start work on an exciting new project with a partner and it makes good sense to sort out this issue before coding starts in earnest in the next few weeks.
I acknowledge that there is a bit of an overhead in running a version control system, but the advantages more than outweigh the disadvantages.
For me the main disadvantage is having to learn a new way of working and get my head around the ins and outs of the version control system. The advantages are:
  • always knowing where I am with respect to code versions;
  • being able to regress changes easily by "rolling back" to an older version, or being able to "undelete" files which have been marked for deletion;
  • having a repository on another machine means I have a backup of the code by default, albeit minus any committed changes.
Fortunately, I spotted an article in an recent version of Linux Format magazine which compared three open-source version control systems, namely: Bazaar, Git and Subversion. After some fairly careful consideration, I opted to install Subversion on my server.

The manual for Subversion, which, like the software is free, runs to something like 480 pages. It all seems a bit daunting to start with, but thanks to another article in Linux Format magazine and a couple of 'how to' articles, including one particularly good one by MichaƂ Wojciechowski , I had a fully functioning Subversion server up and running within an hour or so.

Now, all I have to do is read the manual, become familiar with Subversion and move my websites into the repository.

Simple!