Friday, November 30, 2007

Pear Channel on GoogleCode

I recently devised a way to host a Pear Channel on GoogleCode.

What is Pear?

Pear stands for PHP Extension And Repository. It consists of well, you guest it, extensions and a repository for those. The beauty of Pear comes from its managed installation process: one can easily upgrade PHP Extensions using the services of Pear. For those not yet acquainted with PHP, you can consult the official PHP site.

Why GoogleCode?

The reasons I wanted to host a Pear Channel on GoogleCode where simple:

  • Low cost: GoogleCode Project hosting is free
  • Capacity: 100MB of storage per project
  • SVN access
  • Bandwidth

Challenge #1: Pear documentation

In general, the documentation related to the Pear Extensions themselves is good. What was lacking in this instance was the documentation on the REST interface. I had to reverse engineer the PHP code of Pear as well as well as tear apart the Pear’s WEB site REST repository.

Challenge #2: Pear bug

Pear is a marvelous tool to say the least but in the case at hand here, a bug slowed me down quite a bit. The Pear installation tool can’t process files of MIME type ‘text/plain’ when served with HTTP-compression Transfer-Encoding (see the standard). This is quite annoying as by default GoogleCode Apache servers do serve those files transfer-encoded using the ‘chunked’ method.

I have filed a bug report on this issue here.

The Quick Fix

The quick fix, whilst waiting for Pear v1.7.0, is to set the MIME-type of the text files required by the Pear REST interface to ‘application/gzip’. This effectively fools GoogleCode into believing that the said files are already compressed. This trick forces GoogleCode servers to send the text files without further transfer-encoding.


I have also done a presentation on this subject: Pear Channel Presentation on GooglePresentation .

No comments:

Post a Comment