feat: add ObjectStorage and ObjectInfo framework components
- Add ObjectStorage and ObjectInfo classes for framework storage - Update build-image.yml workflow configuration
This commit is contained in:
@@ -772,7 +772,11 @@ jobs:
|
|||||||
deploy-staging:
|
deploy-staging:
|
||||||
name: Auto-deploy to Staging
|
name: Auto-deploy to Staging
|
||||||
needs: [changes, build, runtime-base]
|
needs: [changes, build, runtime-base]
|
||||||
if: (github.ref_name == 'staging' || github.head_ref == 'staging' || (github.ref_name == '' && contains(github.ref, 'staging'))) && needs.changes.outputs.needs_build == 'true'
|
if: >
|
||||||
|
(github.ref_name == 'staging' || github.head_ref == 'staging' || (github.ref_name == '' && contains(github.ref, 'staging')))
|
||||||
|
&& needs.changes.result == 'success'
|
||||||
|
&& (needs.build.result == 'success' || needs.build.result == 'skipped')
|
||||||
|
&& (needs.runtime-base.result == 'success' || needs.runtime-base.result == 'skipped')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment:
|
environment:
|
||||||
name: staging
|
name: staging
|
||||||
|
|||||||
16
src/Framework/Storage/ObjectInfo.php
Normal file
16
src/Framework/Storage/ObjectInfo.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Framework\Storage;
|
||||||
|
|
||||||
|
final readonly class ObjectInfo {
|
||||||
|
public function __construct(
|
||||||
|
public string $bucket,
|
||||||
|
public string $key,
|
||||||
|
public ?string $etag = null, // z.B. sha256
|
||||||
|
public ?int $size = null,
|
||||||
|
public ?string $contentType = null,
|
||||||
|
public array $metadata = [], // frei (owner, width, height, …)
|
||||||
|
public ?string $versionId = null // S3: echt, FS: emuliert/optional
|
||||||
|
) {}
|
||||||
|
}
|
||||||
17
src/Framework/Storage/ObjectStorage.php
Normal file
17
src/Framework/Storage/ObjectStorage.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Framework\Storage;
|
||||||
|
|
||||||
|
interface ObjectStorage
|
||||||
|
{
|
||||||
|
public function put(string $bucket, string $key, string|mixed $body, array $opts = []): ObjectInfo;
|
||||||
|
public function get(string $bucket, string $key): string;
|
||||||
|
public function stream(string $bucket, string $key); // resource|StreamInterface
|
||||||
|
public function head(string $bucket, string $key): ObjectInfo;
|
||||||
|
public function delete(string $bucket, string $key): void;
|
||||||
|
public function exists(string $bucket, string $key): bool;
|
||||||
|
|
||||||
|
// Links
|
||||||
|
public function url(string $bucket, string $key): ?string; // öffentlich, wenn möglich
|
||||||
|
public function temporaryUrl(string $bucket, string $key, \DateInterval $ttl, array $opts = []): string;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user