Blog left intentionaly blank

Hello to you all. (Both?) What's new this week? Well, I've been playing with CakePHP. It's a PHP framework that works on the MVC pattern and have some very nice 'scaffolding' and helper features. I've not had chance to play with it much yet, but it seems to be what I've been looking for to fill the gap between an empty .php file and a Drupal installation.

Next week sees the release of Grand Theft Auto IV, and it seems to have rekindled some excitement within me. I'm sure I've blogged about my lack of enthusiasm when it comes to games in the past (maybe I should try the spangly new search feature of this site) but I'm actually looking forward to this one! And as if to prove the existence of sod's law, my brother's XBox has suffered the Red Ring of Death just in time to leave him without a console to play it on.

The site that brought all work in our office to a standstill this week was, The Daily Mash. Read. Enjoy.

Oh, for the history/photography buffs, here are some pretty cool photos. (note that some might be considered slightly NSFW). They contain all manner of historic things… War scenes, Monroe, early computing and general weirdness. In fact, they're like all the images that get forwarded via email nowadays, except some of these are quite moving, and are all from a time long before the prefix 'FW:' meant that the subject was neither new nor funny.

Photos 1
Photos 2
Photos 3

And, in keeping with the war/history theme, here's a tank they found in a lake, that started without replacing any significant parts!

Tank in a lake.
(Decent pictures at the bottom)

Waffle about: 

Search Me..

Nothing much to report this week (seems to be a weekly blog nowadays) other than a couple of changes to this site.

Firstly, you may have noticed the appearance of a search box which should help find content on this site. (Well, ok, it’ll help me find things, but it’s available to all)

Secondly, I’ve binned the book reviews page as nobody was reading it and I wasn’t writing it, either. In it’s place I’ve added an articles page which is where you’ll find (hopefully) more useful content.

Oh there was something else.. Behind the scenes I’ve plugged in an anti spam filter. A slightly different one this. It’s called Mollom.

Basically, it acts as a central spam filter that other sites can sign up to use (via a webservice). So, when someone posts a comment here, it gets run past Mollom which compares it to it’s Spam database and gives the thumbs up/down.

It also happens to be written by the guy who started Drupal, so probably worth a go 🙂

More details here

Adding Projects To CVS

Let's say you've got a website or a directory of code somewhere that you've finaly got around to putting into CVS. I keep having to do this, and I keep messing it up so here's a quick cheat sheet type run through.

This example is based on OSX and the command line version of CVS with a local repository.

Adding a project (module) to CVS

For the purposes of this example, I'm going to assume that you have a local directory called 'htdocs' in which you keep all your various web sites. So, it looks something like this:

Right, now let's say you have another web site called www.testing.com which you want to add to CVS, and to your local developement environment (in htdocs).

First of all, grab a copy of all the files that make up that website, and put them in a folder called www.testing.com on your desktop (or whichever location you prefer.) This is only a temporary folder as once the code is in CVS, we'll delete it.

Now, get a terminal session and make your way to the www.testing.com directory. (Otherwise known as cd'ing into that directory). Now we're going to add the contents of this directory to CVS.

#cvs import -m “Initial import” www.testing.com Garry Start

In English, this says “import everything in this directory into CVS, give it a module name of www.testing.com, my name is Garry, I want to label this import with 'Initial Import' and tag it with 'Start' “. Don't worry about the name and the tag bit for now.

You should now see CVS listing all the files it's importing, with a N at begining to show it's a New file:


Macintosh:www.testing.com garry$ cvs import -m "Initial Import" www.testing.com Garry Start
N www.testing.com/.DS_Store
N www.testing.com/index.html
cvs import: Importing /Users/garry/Documents/cvsrep/www.testing.com/images
N www.testing.com/images/Picture2.png

No conflicts created by this import

If like me you're naturaly distrusting of computers, you can verify that your project is now in CVS by telling CVS to list all it's modules (projects):

#cvs rls


Macintosh:www.testing.com garry$ cvs rls
cvs rls: Listing module: `.'
CVSROOT
drupal5.3
www.example.com
local.devsite.com
www.testing.com

In there you should see www.testing.com. To see what's in that particular module, specify the module name on the end of the rls command:

#cvs rls www.testing.com


Macintosh:www.testing.com garry$ cvs rls www.testing.com
cvs rls: Listing module: `www.testing.com'
.DS_Store
index.html
images

Now our project is in CVS, we can delete the www.testing.com folder from our desktop. (Or archive it if you prefer)

Checking out code to work on

In your terminal session, cd to the 'htdocs' directory where you want to actualy work on the code and we'll get a working copy from CVS

#cvs checkout www.testing.com


Macintosh:htdocs garry$ cvs checkout www.testing.com
cvs checkout: Updating www.testing.com
U www.testing.com/.DS_Store
U www.testing.com/index.html
cvs checkout: Updating www.testing.com/images
U www.testing.com/images/Picture2.png

Now, a quick 'ls' should reveal the newly added www.testing.com directory in your htdocs. Look inside it, and you should see a directory called CVS where CVS keeps its own stuff, along with our files.


Macintosh:htdocs garry$ ls -l www.testing.com
total 8
drwxr-xr-x 5 garry admin 170 Apr 6 18:16 CVS
drwxr-xr-x 4 garry admin 136 Apr 6 18:16 images
-rw-r--r-- 1 garry admin 195 Apr 6 18:05 index.html

Now we're good to go and work on the project files.

Article types: