@@ -1,24 +1,24 @@ |
||
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 | function Archive($data,$filehandle=null) { |
16 | - if(is_resource($filehandle)) { |
|
17 | - return false; |
|
18 | - } |
|
19 | - $data = gzcompress($data); |
|
20 | - $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
21 | - return $data; |
|
16 | + if(is_resource($filehandle)) { |
|
17 | + return false; |
|
18 | + } |
|
19 | + $data = gzcompress($data); |
|
20 | + $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data; |
|
21 | + return $data; |
|
22 | 22 | |
23 | 23 | } |
24 | 24 | ?> |
25 | 25 | \ No newline at end of file |