website/public/API/queries/skills.php

23 lines
725 B
PHP
Raw Normal View History

2022-03-08 10:04:11 +01:00
<?php
function getSkills() {
2022-03-08 15:11:10 +01:00
require "./lib/config.php";
2022-03-08 10:04:11 +01:00
$s3Client = new Aws\S3\S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'endpoint' => $S3Server,
'use_path_style_endpoint' => true,
'credentials' => [
'key' => $S3AccessKey,
'secret' => $S3SecretKey,
],
]);
$result = $s3Client->ListObjects(['Bucket' => $S3BucketName, 'Delimiter'=>'/', 'Prefix' => 'skills/']);
$response = [];
foreach ($result["Contents"] as $skill){
array_push($response, $skill["Key"]);
}
return $response;
}