Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: S3Compatible storage adapter #76

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove use function statements, remove strict_types statements
  • Loading branch information
haymaker committed Jun 5, 2023
commit 890b8c0be888d3ff8bf5215304098d52c2028669
3 changes: 1 addition & 2 deletions src/Storage/Device/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Utopia\Storage\Device;

use Exception;
use function ltrim;
use Utopia\Storage\Device;
use Utopia\Storage\Storage;

Expand Down Expand Up @@ -484,7 +483,7 @@ private function listObjects($prefix = '', $maxKeys = 1000, $continuationToken =
];

if ($this->vhost) {
$parameters['prefix'] = ltrim($prefix, '/'); /** S3 specific requirement that prefix should never contain a leading slash */
$parameters['prefix'] = \ltrim($prefix, '/'); /** S3 specific requirement that prefix should never contain a leading slash */
}

if (! empty($continuationToken)) {
Expand Down
5 changes: 1 addition & 4 deletions src/Storage/Device/S3Compatible.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php

declare(strict_types=1);

namespace Utopia\Storage\Device;

use function preg_replace;
use Utopia\Storage\Storage;

/**
Expand Down Expand Up @@ -54,7 +51,7 @@ public function __construct(string $endpoint, string $root, string $accessKey, s
* <scheme>:https://<clientid.endpoint.url>/<bucket>
* <scheme>:https://<bucketvhost.endpoint.url>
*/
$endpoint = preg_replace('/^https?:\/\//i', '', $endpoint);
$endpoint = \preg_replace('/^https?:\/\//i', '', $endpoint);
$this->headers['host'] = $endpoint;
}

Expand Down
2 changes: 0 additions & 2 deletions tests/Storage/Device/S3CompatibleTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Utopia\Tests\Storage\Device;

use Utopia\Storage\Device\S3Compatible;
Expand Down