PHPackages                             ics/medias-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. ics/medias-bundle

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

ics/medias-bundle
=================

File Manager for symfony

0.1.3(2y ago)31792MITJavaScript

Since Mar 31Pushed 2y ago3 watchersCompare

[ Source](https://github.com/imperiumclansoftware/medias-bundle)[ Packagist](https://packagist.org/packages/ics/medias-bundle)[ RSS](/packages/ics-medias-bundle/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (10)Dependencies (15)Versions (13)Used By (2)

Imperium Clan Software - Medias-Bundle
======================================

[](#imperium-clan-software---medias-bundle)

Bundle for file management in symfony

Installation
------------

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Applications that use Symfony Flex

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
composer require ics/medias-bundle
```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

#### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require ics/medias-bundle
```

#### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    ICS\MediaBundle\MediaBundle::class => ['all' => true],
];
```

#### Step 3: Install Database

[](#step-3-install-database)

For install database :

```
# Installer la base de données

php bin/console doctrine:schema:create
```

For update database :

```
# Mise a jour la base de données

php bin/console doctrine:schema:update -f
```

Configuration
-------------

[](#configuration)

### Routing

[](#routing)

```
#config/routes.yaml

#...

media_bundle:
  resource: '@MediaBundle/config/routes.yaml'
  prefix: /medias

#...
```

### Medias configuration

[](#medias-configuration)

You can configure relative path from the public directory. The medias files will be stored in this directory

```
# config/packages/medias.yaml

medias:
    path: 'medias' # Default Value
```

Usage
-----

[](#usage)

The Mediabundle propose two FormType `MediaType` that return One MediaFile and `MediaCollectionType` that retun Many MediaFile. You may precise the outputdir relative to medias path in the config.

### Entity

[](#entity)

```
use ICS\MediaBundle\Entity\MediaImage;

// Exemple entity

public class User
{
    /**
     * Avatar of user
     *
     * @var MediaImage
     * @ORM\ManyToOne(targetEntity=MediaImage::class, cascade={"persist","remove"})
     */
    private $avatar;

    /**
     * Gallery of user
     *
     * @var ArrayCollection
     * @ORM\ManyToMany(targetEntity=MediaImage::class, cascade={"persist","remove"})
     */
    private $gallery;

    public function __construct()
    {
        $this->gallery=new ArrayCollection();
    }
}
```

### FormType

[](#formtype)

```
    //...
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        // For One file
        $builder->add('avatar',MediaType::class,[
            'outputdir' => 'user/avatar'
        ]);
        // For Many files
        $builder->add('gallery',MediaCollectionType::class,[
            'outputdir' => 'user/gallery'
        ]);
    }
    //...
```

You can impose limitation of type for all and size for `MediaCollectionType`

```
    //...
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        // For One file
        $builder->add('avatar',MediaType::class,[
            'outputdir' => 'user/avatar',
            'required' => false,
            'acceptedFiles' => ['image/jpeg','.jpg'],
        ]);
        // For Many files
        $builder->add('gallery',MediaCollectionType::class,[
            'outputdir' => 'user/gallery'
            'required' => false,
            'acceptedFiles' => MediaImage::$mimes
            'maxFileSize' => '1024' // 1Ko
        ]);
    }
    //...
```

The maxFileSize is calculated based on system capabilities and your configuration. If your configuration is higher of system capabilities, system capabilities is used.

Commands
--------

[](#commands)

Two commands are implemented

### Integrity verification

[](#integrity-verification)

```
php bin/console media:file:verify
```

### Duplicate search

[](#duplicate-search)

```
php bin/console media:search:duplicate
```

Integration
-----------

[](#integration)

### Adding bundle to [EasyAdmin](https://symfony.com/doc/current/bundles/EasyAdminBundle/index.html)

[](#adding-bundle-to-easyadmin)

#### Step 1: Add entities to dashboard

[](#step-1-add-entities-to-dashboard)

Add this MenuItems in your dashboard `Controller/Admin/DashboardController.php`

```
    // Controller/Admin/DashboardController.php
    use ICS\SsiBundle\Entity\User;
    use ICS\SsiBundle\Entity\Log;

    class DashboardController extends AbstractDashboardController
    {
        public function configureMenuItems(): iterable
        {
            // ...
            yield MenuItem::section('Medias', 'fa fa-photo-video');
            yield MenuItem::linkToCrud('Files', 'fa fa-file', MediaFile::class);
            yield MenuItem::linkToCrud('Pictures', 'fa fa-photo', MediaImage::class);
            // ...
        }
    }
```

#### Step 2: Add twig widgets to dashboard

[](#step-2-add-twig-widgets-to-dashboard)

```
    {% extends "@EasyAdmin/page/content.html.twig" %}

    {% block page_content %}

        {{ mediaGraphData() }}

    {% endblock %}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81% 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 ~82 days

Recently: every ~88 days

Total

12

Last Release

966d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b8cd72721fa699d3afa402c0057a9438c0556e734f1128e6ffff0212f3afa42?d=identicon)[ics](/maintainers/ics)

---

Top Contributors

[![ddutas](https://avatars.githubusercontent.com/u/46941784?v=4)](https://github.com/ddutas "ddutas (17 commits)")[![imperiumclansoftware](https://avatars.githubusercontent.com/u/81512366?v=4)](https://github.com/imperiumclansoftware "imperiumclansoftware (4 commits)")

### Embed Badge

![Health badge](/badges/ics-medias-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[prestashop/prestashop

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

9.0k15.4k](/packages/prestashop-prestashop)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[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)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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