@@ -13,7 +13,7 @@ |
||
13 | 13 | * If $prayfile is not null, all the data for this block |
14 | 14 | * will be read from the PRAYFile. |
15 | 15 | * @param PRAYFile $prayfile The PRAYFile that this DFAM block belongs to. |
16 | - * @param $name The block's name. |
|
16 | + * @param string $name The block's name. |
|
17 | 17 | * @param $content The binary data of this block. May be null. |
18 | 18 | * @param $flags The block's flags |
19 | 19 | */ |
@@ -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 |
@@ -1,22 +1,22 @@ |
||
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); |
|
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 | 6 | $data = gzuncompress($data); |
7 | 7 | return $data; |
8 | 8 | } |
9 | 9 | die('Couldn\'t dearchive -- Probably invalid file'); |
10 | 10 | return false; |
11 | - } else if(is_resource($data)) { |
|
11 | + } else if (is_resource($data)) { |
|
12 | 12 | return false; //coming soon |
13 | 13 | } |
14 | 14 | } |
15 | 15 | /** |
16 | 16 | * @param string $data |
17 | 17 | */ |
18 | -function Archive($data,$filehandle=null) { |
|
19 | - if(is_resource($filehandle)) { |
|
18 | +function Archive($data, $filehandle = null) { |
|
19 | + if (is_resource($filehandle)) { |
|
20 | 20 | return false; |
21 | 21 | } |
22 | 22 | $data = gzcompress($data); |