<?php
namespace App\Controller\Web;
#use App\Entity\Post;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Aws\S3\S3Client;
use Aws\Exception\AwsException;
use Aws\Credentials\CredentialProvider;
class DashboardController extends AbstractController
{
/**
* @Route("/", name="dashboard")
*/
public function index()
{
//$posts = $this->getDoctrine()->getRepository(Post::class)->findLatest();
// $s3Client = new S3Client([
// 'region' => 'eu-central-1',
// 'version' => 'latest',
// 'credentials' => CredentialProvider::env()
// ]);
// $objects = $s3Client->getIterator('ListObjects', array(
// 'Bucket' => 'fxlmwpmedia',
// 'Prefix' => 'wp-content/plugins/fxl-economic-calendar/admin/assets/images/flags/flat/32/'
// ));
// foreach ($objects as $object) {
// // dump($object['Key']);
// }
//die;
/*
//Listing all S3 Bucket
$CompleteSynchronously = $s3Client->listBucketsAsync();
// Block until the result is ready.
$CompleteSynchronously = $CompleteSynchronously->wait();
foreach ($CompleteSynchronously['Buckets'] as $bucket) {
echo $bucket['Name'] . "\n";
}
die;
*/
return $this->render('dashboard/index.html.twig', [
//'posts' => $posts,
]);
}
}