ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit

This commit is contained in:
2023-02-01 09:03:27 +01:00
parent fb33724d9b
commit 9554b9cdd3
235 changed files with 2964 additions and 1573 deletions

View File

@ -106,6 +106,8 @@ class MinioService
$tmpdir = $this->rootPath.'/var/tmp';
@unlink($tmpdir.'/'.$filename);
}
return true;
}
/**
@ -173,17 +175,18 @@ class MinioService
}
/**
* listKeys.
* listFiles.
*
* @return array
*/
public function listKeys(string $prefix)
public function listFiles(string $prefix, string $delimiter = '')
{
// On utilise un path spécifique car listObjectsV2 utilise une autre config de client
try {
$response = $this->client->listObjectsV2([
'Bucket' => $this->minioBucket,
'Prefix' => $prefix,
'Delimiter' => $delimiter,
]);
return $response->get('Contents');
@ -193,6 +196,28 @@ class MinioService
}
}
/**
* listFolders.
*
* @return array
*/
public function listFolders(string $prefix, string $delimiter = '')
{
// On utilise un path spécifique car listObjectsV2 utilise une autre config de client
try {
$response = $this->client->listObjectsV2([
'Bucket' => $this->minioBucket,
'Prefix' => $prefix,
'Delimiter' => $delimiter,
]);
return $response->get('CommonPrefixes');
} catch (Exception $e) {
\Sentry\captureException($e);
throw new Exception(self::ERR_UNAVAILABLE);
}
}
/**
* download.
*