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:
2025-11-01 21:53:23 +01:00
parent 9ecc88a0eb
commit 477522bc1e
3 changed files with 38 additions and 1 deletions

View File

@@ -772,7 +772,11 @@ jobs:
deploy-staging:
name: Auto-deploy to Staging
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
environment:
name: staging

View 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
) {}
}

View 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;
}