A few months ago, David Brady's company gave a small, fourteen-page web application assignment to a contractor they had worked with in the past. Although he was known for over engineering and for refusing to accept any alterations to the purity of his designs, the contractor assured them that he could complete it in two weeks so long as he could work "undistracted" (read: unsupervised). The company was really in a pinch and figured that, worst case, he'd take a little more than a month to finish it. They gave him the go-ahead.

Four months into the project, the contractor said he might be able to finish in three more months, but wasn't promising anything. Fortunately, David was able to convince his higher-ups to dump the contractor and finish the application internally. Unfortunately, David was the one assigned to finish it.

Although plenty there were plenty of "oddities" in the horrible mess of 50,000+ lines of code delivered, today's example comes from the application's installation guide. As it turns out, the contractor had written a class to handle ZIP Codes, and, ignoring the large body of work in the field of compression technology, chose to name the class handling this "Zip". Following is how he reconciled his design when he discovered the collision with the PHP compression library of the same name ...

--------------------------------------------------------------------+
                             Troubleshooting, Continued             +
--------------------------------------------------------------------+

Q: I'm receiving the following "Fatal Error" Messages:
    
     Fatal Error: Cannot redeclare class Zip in 
     [install_path]\php_includes\classes\Zip.php

A. This is a result of the application loading the PHP Zip class. To
   solve the problem,
     1. Navigate to and open the php.ini file.
     2. Search for the extension "php_zip.dll"
     3. Comment it out with a semi-colon (";extension=php_zip.dll")
     4. Restart the Apache service

Since the other applications on the server required the Zip (as in, compression) library, David took an alternative approach to reconciling the collision. He sifted through the 50,000+ lines of code and sought to rename the Zip class to ZipCode. Since it was used exactly once, it was pretty easy to do.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!