Saturday

Using CI to Communicate

Using CI to Communicate

The main strength of the Internet is its ability to communicate. This chapter looks at
three ways in which CI makes communication easier.

First, we'll add to our testing toolkit by using CI's FTP class to access remote
files directly.

Then, we'll use the email class to make our site automatically email us when certain
conditions are met.

Lastly, we'll venture into Web 2.0 territory—using XML-RPC to create a private
'web service' that allows our remote sites to take action and return information on a
request form our testing site.

Using the FTP Class to Test Remote Files
File Transfer Protocol (FTP) is a method of transferring files over the Internet. It's
normally used to move files backwards and forwards to your website, using a special
FTP program. It's something most of us only use occasionally, when we are putting
up a new site.

You can, however, automate the whole process painlessly with CI. One use is to
test the integrity of your remote site: are the files still there? As a website owner,
you always face the possibility that someone will tamper with the files on your site.
It may just be your ISP or your server admin, mistakenly deleting or over-writing
something. (I had this happen to me once, when my ISP rebuilt their server and
forgot to reload one of my application files. The file concerned wasn't used very
often, but mattered a lot when it was. This led to an interesting error that took some
time to track down!)