Buffalo Eats Online API Documentation

S3StorageDriver
in package
implements StorageDriverInterface

Amazon S3 storage driver.

Uploads processed images to S3 with public-read ACL. Supports optional CloudFront CDN URL via AWS_S3_URL env var.

Tags
author

J.J. Johnson visionquest716@gmail.com

copyright

2026 VisionQuestServices LLC

Table of Contents

Interfaces

StorageDriverInterface
Interface for storage drivers (local filesystem, S3, etc.).

Properties

$bucket  : string
$cdnUrl  : string|null
$client  : S3Client
$region  : string

Methods

__construct()  : mixed
Create the S3 driver from environment variables.
delete()  : void
Delete a file from S3.
exists()  : bool
Check if an object exists in S3.
name()  : string
Get the driver name.
put()  : string
Upload a local file to S3 with public-read ACL.
url()  : string
Get the public URL for an S3-stored file.

Properties

Methods

__construct()

Create the S3 driver from environment variables.

public __construct() : mixed
Tags
throws
RuntimeException

If required AWS env vars are missing

delete()

Delete a file from S3.

public delete(string $storagePath) : void
Parameters
$storagePath : string

Relative storage path (S3 object key)

exists()

Check if an object exists in S3.

public exists(string $storagePath) : bool
Parameters
$storagePath : string

S3 object key

Return values
bool

name()

Get the driver name.

public name() : string
Return values
string

'local' or 's3'

put()

Upload a local file to S3 with public-read ACL.

public put(string $localPath, string $storagePath, string $mimeType) : string
Parameters
$localPath : string

Absolute path to the local file

$storagePath : string

Relative storage path (used as S3 object key)

$mimeType : string

MIME type

Tags
throws
RuntimeException

If upload fails

Return values
string

The storage path

url()

Get the public URL for an S3-stored file.

public url(string $storagePath) : string

Uses CDN URL if configured, otherwise default S3 URL.

Parameters
$storagePath : string

Relative storage path (S3 object key)

Return values
string

Full URL


        
On this page

Search results