imagenes.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. use Aws\S3\S3Client;
  3. use League\Flysystem\AwsS3v3\AwsS3Adapter;
  4. use League\Flysystem\Filesystem;
  5. include __DIR__ . '/vendor/autoload.php';
  6. $client = new S3Client([
  7. 'credentials' => [
  8. 'key' => 'iksop',
  9. 'secret' => '8htoiwn44g204th' ],
  10. 'endpoint' => 'https://s3.infra.flowdat.com/minio/login',
  11. 'use_path_style_endpoint' => true,
  12. 'region' => 'sa-east-1',
  13. 'version' => 'latest',]);
  14. $adapter = new AwsS3Adapter($client, 'comparaciones');
  15. $filesystem = new Filesystem($adapter);
  16. $path = $_GET["path"];
  17. $contents = $filesystem->listContents("/");
  18. $dirs = array();
  19. foreach($contents as $cont){
  20. $dirs[] = $cont["path"];
  21. }
  22. $dirs = array_reverse($dirs);
  23. echo "<table align='left' border=1 style='width: 35%'>";
  24. echo "<tr><td align=center><b><a>Lista de Commits</a></b></td></tr>";
  25. for ($i=0; $i<count($dirs); $i++)
  26. {
  27. $dir = $dirs[$i];
  28. echo '<tr><td><a href=imagenes.php?path='.$dir.'><font size="3" face="arial">'.$dir.'</font></a></td></tr>';
  29. }
  30. echo "</table>";
  31. if($path == ""){
  32. echo "<h3 align=center style='color: brown;font-family: courier;'>Seleccionar un commit</h3>";
  33. }
  34. else{
  35. echo "<h3 align=center style='color: brown;font-family: courier;'>Comp commit: <u>" . $path . "</u></h3>";
  36. echo "<table align='right' border=1 style='width: 60%'>";
  37. $files = array();
  38. $fscont = $filesystem->listContents("/".$path, true);
  39. foreach($fscont as $cont){
  40. if($cont["type"] === "file"){
  41. $files[] = $cont["path"];
  42. }
  43. }
  44. echo "<tr>";
  45. for ($i=0; $i<count($files); $i++)
  46. {
  47. if($i % 5 == 0) echo "</tr><tr>";
  48. $num = $files[$i];
  49. echo '<td><a href=get.php?path='.$num.'><img src="get.php?path='.$num.'" alt="random image" height="150" width="150"></a>'."&nbsp;&nbsp;</td>\n";
  50. }
  51. echo "</tr>";
  52. echo "</table>";
  53. }