Fix ZipDirectoryReader under Hiphop
authorjeroendedauw <jeroendedauw@gmail.com>
Mon, 27 Aug 2012 15:56:15 +0000 (17:56 +0200)
committerjeroendedauw <jeroendedauw@gmail.com>
Mon, 27 Aug 2012 19:08:03 +0000 (21:08 +0200)
commit0ac587207e97eeb79331fd5d9d72f1075324e612
treed64a53a753d47af5db6cb3f08c8203ddf2f8185a
parentd3f1d418dec7e3bc3e42dc28c321c308b4d28cdb
Fix ZipDirectoryReader under Hiphop

ZipDirectoryReaderError subclasses Exception, and sets the code property as a
string. Php's documentation says this should be an int, so this is already a
little bit weird.

Under Hiphop, calling the parent constructor without the second parameter will
set the code property to 0, because the parameter defaults to 0. This leads to
uploads breaking, because calls to getErrorCode return 0 rather than the code
that was passed in.

The change renames the code property to errorCode, so it can't be confused with
exception's code property, which should be an int.

https://bugzilla.wikimedia.org/show_bug.cgi?id=39346

Patch by Chris Keeline <ckeeline@fb.com>

Change-Id: I9b07a5f7f8ba7c980c0cb0da7b65816dc3b97c4c
includes/ZipDirectoryReader.php