c2ephp

support/Archiver.php

Go to the documentation of this file.
00001 <?php
00002 function DeArchive($data) {
00003     if(is_string($data)) {
00004         if(substr($data,0,55) == "Creatures Evolution Engine - Archived information file.") {
00005             $data = substr($data,strpos($data,chr(0x1A).chr(0x04))+2);
00006             $data = gzuncompress($data);
00007             return $data;
00008         }
00009         die('Couldn\'t dearchive -- Probably invalid file');
00010         return false;
00011     } else if(is_resource($data)) {
00012         return false; //coming soon
00013     }   
00014 }
00015 function Archive($data,$filehandle=null) {
00016     if(is_resource($filehandle)) {
00017         return false;
00018     }
00019     $data = gzcompress($data);
00020     $data = "Creatures Evolution Engine - Archived information file. zLib 1.13 compressed.".chr(0x1A).chr(0x04).$data;
00021     return $data;
00022     
00023 }
00024 ?>
 All Classes Files Functions Variables Enumerations