[s3_storage] Bump version of akeeba/s3 to version 2.3.1

- Address https://github.com/friendica/friendica/issues/12011#issuecomment-1854681792
This commit is contained in:
Hypolite Petovan 2023-12-18 21:28:16 -05:00
parent 9daa11eb10
commit 3e74af9775
61 changed files with 1472 additions and 708 deletions

View file

@ -3,18 +3,18 @@
* Akeeba Engine
*
* @package akeebaengine
* @copyright Copyright (c)2006-2020 Nicholas K. Dionysopoulos / Akeeba Ltd
* @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU General Public License version 3, or later
*/
namespace Akeeba\Engine\Postproc\Connector\S3v4;
namespace Akeeba\S3;
use Akeeba\Engine\Postproc\Connector\S3v4\Exception\PropertyNotFound;
use Akeeba\Engine\Postproc\Connector\S3v4\Response\Error;
use Akeeba\S3\Exception\PropertyNotFound;
use Akeeba\S3\Response\Error;
use SimpleXMLElement;
// Protection against direct access
defined('AKEEBAENGINE') or die();
defined('AKEEBAENGINE') || die();
/**
* Amazon S3 API response object
@ -124,7 +124,7 @@ class Response
*
* @param string|SimpleXMLElement|null $body
*/
public function setBody($body): void
public function setBody($body, bool $rawResponse = false): void
{
$this->body = null;
@ -135,7 +135,7 @@ class Response
$this->body = $body;
$this->finaliseBody();
$this->finaliseBody($rawResponse);
}
public function resetBody(): void
@ -153,7 +153,7 @@ class Response
$this->body .= $data;
}
public function finaliseBody(): void
public function finaliseBody(bool $rawResponse = false): void
{
if (!$this->hasBody())
{
@ -165,8 +165,14 @@ class Response
$this->headers['type'] = 'text/plain';
}
if (is_string($this->body) &&
(($this->headers['type'] == 'application/xml') || (substr($this->body, 0, 5) == '<?xml'))
if (
!$rawResponse
&& is_string($this->body)
&&
(
($this->headers['type'] == 'application/xml')
|| (substr($this->body, 0, 5) == '<?xml')
)
)
{
$this->body = simplexml_load_string($this->body);
@ -332,8 +338,8 @@ class Response
)
{
$this->error = new Error(
$this->code,
(string) $this->body->Message
500,
(string) $this->body->Code . ':' . (string) $this->body->Message
);
if (isset($this->body->Resource))