src/Controller/Web/DashboardController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Web;
  3. #use App\Entity\Post;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Aws\S3\S3Client;
  7. use Aws\Exception\AwsException;
  8. use Aws\Credentials\CredentialProvider;
  9. class DashboardController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/", name="dashboard")
  13.      */
  14.     public function index()
  15.     {
  16.         //$posts = $this->getDoctrine()->getRepository(Post::class)->findLatest();
  17.     // $s3Client = new S3Client([
  18.     //     'region' => 'eu-central-1',
  19.     //     'version' => 'latest',
  20.     //     'credentials' => CredentialProvider::env()
  21.     // ]);
  22.     // $objects = $s3Client->getIterator('ListObjects', array(
  23.     //     'Bucket' => 'fxlmwpmedia',
  24.     //     'Prefix' => 'wp-content/plugins/fxl-economic-calendar/admin/assets/images/flags/flat/32/'
  25.     // ));
  26.     
  27.     
  28.     // foreach ($objects as $object) {
  29.     //   //  dump($object['Key']);
  30.     // }
  31.     
  32.     //die;
  33.     /*
  34.     //Listing all S3 Bucket
  35.     $CompleteSynchronously = $s3Client->listBucketsAsync();
  36.     // Block until the result is ready.
  37.     $CompleteSynchronously = $CompleteSynchronously->wait();
  38.     foreach ($CompleteSynchronously['Buckets'] as $bucket) {
  39.         echo $bucket['Name'] . "\n";
  40.     }
  41.     die;
  42.     */    
  43.         return $this->render('dashboard/index.html.twig', [
  44.             //'posts' => $posts,
  45.         ]);
  46.     }
  47. }