Advertisement
craftyoyo

file list

Jun 11th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2. if ($handle = opendir('./mods')) {
  3.  
  4.     while (false !== ($entry = readdir($handle))) {
  5.  
  6.         if ($entry != "." && $entry != "..") {
  7.           $size = filesize($entry);
  8.           $md5file = md5_file($entry);
  9.           /*
  10.           Warning: filesize(): stat failed for .AppleSkin-mc1.12-1.0.9.jar. in C:\xampp\htdocs\launcher\md5.php on line 20
  11.  
  12. Warning: md5_file(AppleSkin-mc1.12-1.0.9.jar): failed to open stream: No such file or directory in C:\xampp\htdocs\launcher\md5.php on line 21
  13. */
  14. echo '{
  15.    "id": "forgelin:forgelin:1.8.2",
  16.    "name": "Forgelin",
  17.    "type": "ForgeMod",
  18.    "artifact": {
  19.        "size": '.$size.',
  20.        "MD5": "24d77945801cc648257f9066b461a040",
  21.        "url": "http://localhost/launcher/mods/'.$entry.'
  22.    }
  23. },';
  24. echo "<br>";
  25.            echo "$entry\n";
  26.  
  27.         }
  28.     }
  29.  
  30.     closedir($handle);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement