DecodePetconf.php 480 B

12345678910111213141516
  1. #! php.exe -q
  2. # PHP CLI code, to decode config.json with gzcompress and base64
  3. # gzcompress can smaller the string 10 times or more, base64 can make sure that
  4. # the data can be saved and transfered safely by http.
  5. # author: gwang
  6. # version: 1.0
  7. <?php
  8. $filename = $argv[1];
  9. $handle = fopen($filename, "rb");
  10. $contents = fread($handle, filesize($filename));
  11. fclose($handle);
  12. $str = gzuncompress(base64_decode($contents));
  13. // $str = gzinflate(base64_decode($contents));
  14. echo $str;