PHPackages                             survos/media-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. survos/media-bundle

ActiveSymfony-bundle[File &amp; Storage](/categories/file-storage)

survos/media-bundle
===================

Manage media without direct relationships

2.0.182(1mo ago)0276↓25%MITPHPPHP ^8.4

Since Oct 24Pushed 2mo agoCompare

[ Source](https://github.com/survos/media-bundle)[ Packagist](https://packagist.org/packages/survos/media-bundle)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/survos-media-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (38)Versions (128)Used By (0)

Survos Media Bundle
===================

[](#survos-media-bundle)

SurvosMediaBundle provides a **deterministic, URL‑centric media registry** for Symfony applications.

It is intentionally *not* a media processor. Instead, it:

- Registers media references (URLs or local files)
- Assigns **deterministic IDs** derived from URLs
- Stores application‑local media metadata
- Syncs with a centralized media server (future step)
- Generates thumbnail URLs via imgproxy‑style patterns (future step)

This mirrors the relationship between **babel‑bundle** and **lingua‑server**:

- Applications own their media tables
- A central service owns the binaries and heavy processing

---

Core Concept: Deterministic Media IDs
-------------------------------------

[](#core-concept-deterministic-media-ids)

Every media item has a **stable, deterministic ID** derived from its URL.

```
use Survos\MediaBundle\Service\MediaRegistry;

$id = MediaRegistry::idFromUrl('https://example.com/image.jpg');
```

The algorithm:

- Base64‑encodes the URL
- Converts it to URL‑safe base64
- Removes padding

This is the same philosophy used by **imgproxy**.

### Why this matters

[](#why-this-matters)

- No database lookups to resolve URLs
- IDs are reversible
- Same URL → same ID across apps
- Safe primary key for Meilisearch

---

Registering Media
-----------------

[](#registering-media)

The primary entry point is `MediaRegistry`.

```
foreach ($data->images as $imageUrl) {
    $media = $mediaRegistry->ensureMedia($imageUrl);
}
```

### Behavior

[](#behavior)

- Defaults to `Photo`
- No duplicate URLs
- Bulk‑safe (`flush: false`)
- No network calls

Local files are also supported:

```
$media = $mediaRegistry->ensureMedia($uploadedFile);
```

Local files are assigned a temporary `local://` URL until synced.

---

Probing Mediary (Polling Fallback)
----------------------------------

[](#probing-mediary-polling-fallback)

When webhook callbacks are unavailable (for example, local dev tunnels are down), poll mediary directly via the bundle service.

```
use Survos\MediaBundle\Service\MediaBatchDispatcher;

$result = $mediaBatchDispatcher->dispatch('museum', [$url], [
    'callback_url' => 'https://my-app.example/webhook/media',
]);

$assetId = $result->media[0]->mediaKey;
$probe = $mediaBatchDispatcher->probe($assetId);

if ($probe->isComplete()) {
    // use $probe->meta / $probe->context / $probe->ocr / $probe->ai
}
```

Available methods:

- `probe(string $assetId): MediaProbeResult` → calls `GET /fetch/media/{id}`
- `probeMany(array $assetIds): array` → calls `POST /fetch/media/by-ids`

Probe payload includes current workflow state (`marking`), variants/thumb URLs, metadata, and any OCR/AI context that has been written so far.

CLI helper:

```
bin/console media:probe 5c4e0c2d6f8a1b9e
bin/console media:probe "https://example.org/image.jpg"
bin/console media:probe --url "upload://sha256/abcd..."
```

---

What This Bundle Does *Not* Do
------------------------------

[](#what-this-bundle-does-not-do)

- Download media
- Resize images
- Cache thumbnails
- Perform OCR, tagging, or EXIF extraction

Those responsibilities belong to the **media server** and **imgproxy**.

---

Status
------

[](#status)

This bundle is intentionally minimal and evolving.

Next steps include:

- `media:sync` command
- Provider detection (YouTube, Flickr, etc.)
- Thumbnail URL generation helpers

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance88

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

127

Last Release

55d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21b39551f92ed4143772c622f9e571589c5a72c96ab3c53fe67489ce0d83e806?d=identicon)[tacman1123](/maintainers/tacman1123)

---

Top Contributors

[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (19 commits)")

---

Tags

symfonysymfony-uxux

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/survos-media-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/survos-media-bundle/health.svg)](https://phpackages.com/packages/survos-media-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
