ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
This commit is contained in:
@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user