@@ -1,27 +1,27 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | function DeArchive($data) { |
| 3 | - if(is_string($data)) { |
|
| 4 | - if(substr($data,0,55) == "Creatures Evolution Engine - Archived information file.") { |
|
| 5 | - $data = substr($data,strpos($data,chr(0x1A).chr(0x04))+2); |
|
| 6 | - $data = gzuncompress($data); |
|
| 7 | - return $data; |
|
| 8 | - } |
|
| 9 | - die('Couldn\'t dearchive -- Probably invalid file'); |
|
| 10 | - return false; |
|
| 11 | - } else if(is_resource($data)) { |
|
| 12 | - return false; //coming soon |
|
| 13 | - } |
|
| 3 | + if(is_string($data)) { |
|
| 4 | + if(substr($data,0,55) == "Creatures Evolution Engine - Archived information file.") { |
|
| 5 | + $data = substr($data,strpos($data,chr(0x1A).chr(0x04))+2); |
|
| 6 | + $data = gzuncompress($data); |
|
| 7 | + return $data; |
|
| 8 | + } |
|
| 9 | + die('Couldn\'t dearchive -- Probably invalid file'); |
|
| 10 | + return false; |
|
| 11 | + } else if(is_resource($data)) { |
|
| 12 | + return false; //coming soon |
|
| 13 | + } |
|
| 14 | 14 | } |
| 15 | 15 | /** |
| 16 | 16 | * @param string $data |
| 17 | 17 | */ |
| 18 | 18 | function Archive($data,$filehandle=null) { |
| 19 | - if(is_resource($filehandle)) { |
|
| 20 | - return false; |
|
| 21 | - } |
|
| 22 | - $data = gzcompress($data); |
|
| 23 | - $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
| 24 | - return $data; |
|
| 19 | + if(is_resource($filehandle)) { |
|
| 20 | + return false; |
|
| 21 | + } |
|
| 22 | + $data = gzcompress($data); |
|
| 23 | + $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
| 24 | + return $data; |
|
| 25 | 25 | |
| 26 | 26 | } |
| 27 | 27 | ?> |
| 28 | 28 | \ No newline at end of file |