123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- use Aws\S3\S3Client;
- use League\Flysystem\AwsS3v3\AwsS3Adapter;
- use League\Flysystem\Filesystem;
- include __DIR__ . '/vendor/autoload.php';
- $client = new S3Client([
- 'credentials' => [
- 'key' => 'iksop',
- 'secret' => '8htoiwn44g204th' ],
- 'endpoint' => 'https://s3.infra.flowdat.com/minio/login',
- 'use_path_style_endpoint' => true,
- 'region' => 'sa-east-1',
- 'version' => 'latest',]);
- $adapter = new AwsS3Adapter($client, 'comparaciones');
- $filesystem = new Filesystem($adapter);
- $path = $_GET["path"];
- $contents = $filesystem->listContents("/");
- $dirs = array();
- foreach($contents as $cont){
- $dirs[] = $cont["path"];
- }
- $dirs = array_reverse($dirs);
- echo "<table align='left' border=1 style='width: 35%'>";
- echo "<tr><td align=center><b><a>Lista de Commits</a></b></td></tr>";
- for ($i=0; $i<count($dirs); $i++)
- {
- $dir = $dirs[$i];
- echo '<tr><td><a href=imagenes.php?path='.$dir.'><font size="3" face="arial">'.$dir.'</font></a></td></tr>';
- }
- echo "</table>";
- if($path == ""){
- echo "<h3 align=center style='color: brown;font-family: courier;'>Seleccionar un commit</h3>";
- }
- else{
- echo "<h3 align=center style='color: brown;font-family: courier;'>Comp commit: <u>" . $path . "</u></h3>";
- echo "<table align='right' border=1 style='width: 60%'>";
- $files = array();
- $fscont = $filesystem->listContents("/".$path, true);
- foreach($fscont as $cont){
- if($cont["type"] === "file"){
- $files[] = $cont["path"];
- }
- }
- echo "<tr>";
- for ($i=0; $i<count($files); $i++)
- {
- if($i % 5 == 0) echo "</tr><tr>";
- $num = $files[$i];
- echo '<td><a href=get.php?path='.$num.'><img src="get.php?path='.$num.'" alt="random image" height="150" width="150"></a>'." </td>\n";
- }
- echo "</tr>";
- echo "</table>";
- }
|