PHPackages                             coshi/mediabundle - 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. [Image &amp; Media](/categories/media)
4. /
5. coshi/mediabundle

ActiveLibrary[Image &amp; Media](/categories/media)

coshi/mediabundle
=================

Simple Media bundle

v0.2.0(10y ago)32.0k2[1 PRs](https://github.com/codesushi/coshimediabundle/pulls)MITPHPPHP &gt;=5.3.2

Since Jan 5Pushed 9y ago3 watchersCompare

[ Source](https://github.com/codesushi/coshimediabundle)[ Packagist](https://packagist.org/packages/coshi/mediabundle)[ RSS](/packages/coshi-mediabundle/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (11)Versions (3)Used By (0)

CoshiMediaBundle
================

[](#coshimediabundle)

MediaBundle - for Symfony 2

Provides
--------

[](#provides)

This bundle provides a service and base entity class. Events are dispached after each media manager service action.

Setup
-----

[](#setup)

1. Create your media bundle for example AcmeMediaBudle - \[optional step - only creation of entity is required\]
2. Create Media entity which extends Coshi\\MediaBundle\\Entity\\Media, add id column and mapping of your choice \[ if bundle had been created create entity in that bundle \]
3. Add CoshiMediaBundle configuration to your appliaction's config.yml see config reference. Note that you have to create media\_path in your web\_root and give them proper permissions
4. Add CoshiMediaBundle to your AppKernel.php
5. Update your database schema
6. Add desired entities which have attached media and implement interfaces Coshi\\MediaBundle\\Model\\MediaInterface for desired entity
7. Now you can use coshi\_media.media\_manager service to perform file upload as simple as

    ```
     $this->get('coshi_media.media_manager')->create($uploadedFileObject);
     $this->getDoctrine()->getManager()->flush();

    ```

Minimal configuration for storing files on local filesystem
-----------------------------------------------------------

[](#minimal-configuration-for-storing-files-on-local-filesystem)

```
coshi_media:
    media_class: AppBundle\Entity\Media

    #Adapters definiton
    adapters:
        local:
            directory: media
            create: true

    filesystems:
        local:
            adapter: local

    filesystem_default: local

```

Currentluy only Amazon S3 and Local filesystem are supported.

Configuration reference
-----------------------

[](#configuration-reference)

```
coshi_media:
    media_class: Webfit\MO\MediaBundle\Entity\Media

    #Adapters definiton
    adapters:
        local:
            directory: media_upload_delete_work
            create: true
        aws_s3:
            service_id: aws_s3.client #name of amazon service
            bucket_name: test-mediabundle
            options:
                directory: media_bundle_adapter_upload

    #Filesystems/storage definition
    filesystems:
        local:
            adapter: local
        amazon:
            adapter: aws_s3

    #Optional parameter
    filesystem_default: amazon

```

Twig Extension
--------------

[](#twig-extension)

This bunlde provides simple extension to render a path to media in Twig

```
   {{ coshi_media_url(media) }}

```

Where of course media is a instance of mapped media class

Events
------

[](#events)

Bundle generates couple events they are defined in Coshi\\MediaBundle\\MediaEvents Events occurs on create of medium, update and delete. This is the way to extend bundle functionality.

```
    MediaEvents::CREATE_MEDIA
    MediaEvents::UPDATE_MEDIA
    MediaEvents::DELETE_MEDIA

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.6% 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 ~29 days

Total

2

Last Release

3803d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3d1a78d51f48df425a29607ea5a340c6d7926517486c9d10683e498292ad3a5?d=identicon)[kozog](/maintainers/kozog)

---

Top Contributors

[![kozog](https://avatars.githubusercontent.com/u/178385?v=4)](https://github.com/kozog "kozog (17 commits)")[![tdfkris](https://avatars.githubusercontent.com/u/17857704?v=4)](https://github.com/tdfkris "tdfkris (10 commits)")[![dominikjaglo](https://avatars.githubusercontent.com/u/3235011?v=4)](https://github.com/dominikjaglo "dominikjaglo (1 commits)")[![workxdo](https://avatars.githubusercontent.com/u/20838846?v=4)](https://github.com/workxdo "workxdo (1 commits)")

---

Tags

mediauploads

### Embed Badge

![Health badge](/badges/coshi-mediabundle/health.svg)

```
[![Health](https://phpackages.com/badges/coshi-mediabundle/health.svg)](https://phpackages.com/packages/coshi-mediabundle)
```

###  Alternatives

[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k185.6M2.4k](/packages/symfony-security-bundle)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[contao-community-alliance/dc-general

Universal data container for Contao

1680.8k92](/packages/contao-community-alliance-dc-general)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)

PHPackages © 2026

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