@@ -17,11 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | if($endianness === true){ // big-endian |
| 19 | 19 | $f = 'N'; |
| 20 | - } |
|
| 21 | - elseif($endianness === false){ // little-endian |
|
| 20 | + } elseif($endianness === false){ // little-endian |
|
| 22 | 21 | $f = 'V'; |
| 23 | - } |
|
| 24 | - else{ // machine byte order |
|
| 22 | + } else{ // machine byte order |
|
| 25 | 23 | $f = 'L'; |
| 26 | 24 | } |
| 27 | 25 | |
@@ -34,11 +32,9 @@ discard block |
||
| 34 | 32 | |
| 35 | 33 | if($endianness === true){ // big-endian |
| 36 | 34 | $f = 'J'; |
| 37 | - } |
|
| 38 | - elseif($endianness === false){ // little-endian |
|
| 35 | + } elseif($endianness === false){ // little-endian |
|
| 39 | 36 | $f = 'P'; |
| 40 | - } |
|
| 41 | - else{ // machine byte order |
|
| 37 | + } else{ // machine byte order |
|
| 42 | 38 | $f = 'Q'; |
| 43 | 39 | } |
| 44 | 40 | |
@@ -51,11 +47,9 @@ discard block |
||
| 51 | 47 | |
| 52 | 48 | if($endianness === true){ // big-endian |
| 53 | 49 | $f = 'G'; |
| 54 | - } |
|
| 55 | - elseif($endianness === false){ // little-endian |
|
| 50 | + } elseif($endianness === false){ // little-endian |
|
| 56 | 51 | $f = 'g'; |
| 57 | - } |
|
| 58 | - else{ // machine byte order |
|
| 52 | + } else{ // machine byte order |
|
| 59 | 53 | $f = 'f'; |
| 60 | 54 | } |
| 61 | 55 | |
@@ -173,16 +173,13 @@ |
||
| 173 | 173 | // $Flags is supposed to be a bitmask |
| 174 | 174 | if($file->Flags === 1){ // no compression |
| 175 | 175 | $bytesWritten = \file_put_contents($dest, $content); |
| 176 | - } |
|
| 177 | - elseif($file->Flags === 3){ // deflate (probably unsed) |
|
| 176 | + } elseif($file->Flags === 3){ // deflate (probably unsed) |
|
| 178 | 177 | $bytesWritten = \file_put_contents($dest, \gzinflate($content)); |
| 179 | - } |
|
| 180 | - elseif($file->Flags === 5){ // lzma (requires ext-xz) |
|
| 178 | + } elseif($file->Flags === 5){ // lzma (requires ext-xz) |
|
| 181 | 179 | // https://bitbucket.org/mugadr_m/wildstar-studio/issues/23 |
| 182 | 180 | $content = \substr($content, 0, 5).\pack('Q', $file->SizeUncompressed).\substr($content, 5); |
| 183 | 181 | $bytesWritten = \file_put_contents($dest, \xzdecode($content)); |
| 184 | - } |
|
| 185 | - else{ |
|
| 182 | + } else{ |
|
| 186 | 183 | throw new WSDBException('invalid file flag'); |
| 187 | 184 | } |
| 188 | 185 | |