No, this isn't what you thought the subject of this post meant. It's
better.
I just wanted to share with you something I did that makes editing PHP
and carrying your projects back and forth a little easier. (That's
what I mean by portability in this case.)
I often go between my day job and my home, carrying code. I used to
either email it to myself and pick it up, or FTP it to my website, or
risk everything and put it on a floppy. (Most often the floppy would
fail.)
Then came along this USB Memory Key thing. I picked up one from Dell
that I thought was really durable and affordable. Try $35 for 128MB
(Oct 2003 price). So I started putting my PHP code there.
Then it dawned on me. Why don't I use my Linux and Apache to
automatically mount my web directory with the latest project directory
when I insert my USB Memory Key in? That way, I don't have to copy
files around because I'm always editing them on the USB Memory Key. I
found that this was sufficiently fast, and you probably will to.
So, how does that work, exactly?
I'd rather answer your questions about it specifically than take the
time to spell it all out, dumping Bash code scripts and so on, but
it's really relatively simple. You can probably take the concepts here
and do the same thing on Windows with Apache or IIS.
The way I do this is to first do the steps to mount my USB Memory Key
in Linux. It shows up on my system as /dev/sda1 and I mount to
"/mnt/thumb" (thumb drive). If you do a search on Google Groups for
"googlemike usb", you'll find out this is done, but I found it can
involve "sudo" and "sudoers", as you'll see in that post.
Next, I made an icon on my desktop that I double-click. It's linked to
a Bash script. It asks if I want to mount or unmount the memory key.
Next, I made a soft link (Windows users can make a shortcut) from
inside my Apache's web directory at /var/www/html to point to
/mnt/thumb/projects/php/. Now when I point my web browser or IDE
there, it shows up.
There's a catch. The files must be edited as root, evidently, so I
have to make my PHP IDE -- Quanta -- load as root and edit the files
at /mnt/thumb/projects/php. The way I do that is with "sudo" and
"sudoers". My GNOME desktop icon for Quanta does:
sudo -u root /usr/bin/quanta
Now I can move quicker between office and home, carrying my latest PHP
code with me, and I don't have to use any file manager or type any
commands.
If you want more detail, ask me what you will and I'll try to help
you.