PHPackages                             cinghie/yii2-media - 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. cinghie/yii2-media

ActiveYii2-extension[File &amp; Storage](/categories/file-storage)

cinghie/yii2-media
==================

Yii2 Media to manage a files on Yii2 site.

2611PHP

Since Jan 26Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/cinghie/yii2-media)[ Packagist](https://packagist.org/packages/cinghie/yii2-media)[ RSS](/packages/cinghie-yii2-media/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Media
==========

[](#yii2-media)

[![License](https://camo.githubusercontent.com/0dac7091e8e4cf2735940777399830bf1e7c5b21e9fcd1ae4fe3192274ceb7ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63696e676869652f796969322d6d656469612e737667)](https://camo.githubusercontent.com/0dac7091e8e4cf2735940777399830bf1e7c5b21e9fcd1ae4fe3192274ceb7ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63696e676869652f796969322d6d656469612e737667)[![Latest Stable Version](https://camo.githubusercontent.com/abaa87bbff278d7c54e4147db5ebd5304b322a0268b41d72e1a765f3af092949/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f63696e676869652f796969322d6d656469612e737667)](https://camo.githubusercontent.com/abaa87bbff278d7c54e4147db5ebd5304b322a0268b41d72e1a765f3af092949/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f63696e676869652f796969322d6d656469612e737667)[![Latest Release Date](https://camo.githubusercontent.com/315d801e2b2afc5b224e75b0cb82881cd308c0a69ffa5e809f321a1ce0cc95fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63696e676869652f796969322d6d656469612e737667)](https://camo.githubusercontent.com/315d801e2b2afc5b224e75b0cb82881cd308c0a69ffa5e809f321a1ce0cc95fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63696e676869652f796969322d6d656469612e737667)[![Latest Commit](https://camo.githubusercontent.com/397aba11690f675760710a175e357143d0e966e593422e5abc8efafba451738a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63696e676869652f796969322d6d656469612e737667)](https://camo.githubusercontent.com/397aba11690f675760710a175e357143d0e966e593422e5abc8efafba451738a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63696e676869652f796969322d6d656469612e737667)[![Total Downloads](https://camo.githubusercontent.com/ce91afeeef6493f4aaa9ed896d49d6a6167966e22f5b21360dabbf99cf9e02ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63696e676869652f796969322d6d656469612e737667)](https://packagist.org/packages/cinghie/yii2-media)

Yii2 Media to manage files on Yii2 site like Wordpress Media Management

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require cinghie/yii2-media "*"

```

or add

```
"cinghie/yii2-media": "*"

```

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

[](#configuration)

### 1. Update yii2-media database schema

[](#1-update-yii2-media-database-schema)

Make sure that you have properly configured `db` application component and run the following command:

```
$ php yii migrate/up --migrationPath=@vendor/cinghie/yii2-media/migrations

```

### 2. Set configuration file

[](#2-set-configuration-file)

Set on your configuration file:

```
'modules' => [

	// Yii2 Media
	'media' => [
		'class' => 'cinghie\media\Media',
		'mediaNameType' = 'casual'; // casual or original
		'mediaPath' => '@frontend/web/media/',
		'mediaThumbsPath' => '@frontend/web/media/thumbs/',
		'mediaURL' => $params['media']['mediaURL'],
		'mediaThumbsURL' => $params['media']['mediaThumbsURL'],
		'mediaRoles' => ['admin'],
		'mediaType' = ['jpg','jpeg','gif','png','csv','xls','xlx','pdf','txt','doc','docs','mp3','mp4'];
		'tinyPngAPIKey' => 'YOUR_TINIFY_API_KEY',
		'showTinify' => false,
		'showTitles' => false
	],

]

```

### 2. Set frontend filter

[](#2-set-frontend-filter)

To disable media management on frontend, set on config:

```
'modules' => [

	// Yii2 Media
	'media' => [
		'class' => 'cinghie\media\Media',
		'as frontend' => 'cinghie\media\filters\FrontendFilter',
	],

]

```

### 3. Install FFmpeg

[](#3-install-ffmpeg)

On Linux

```
apt-get install ffmpeg

whereis ffmpeg

```

Overrides
---------

[](#overrides)

Override controller example, on modules config

```
'modules' => [

	'media' => [
		'class' => 'cinghie\media\Media',
		'controllerMap' => [
			'default' => 'app\controllers\DefaultController',
		]
	]

],

```

Override models example, on modules config

```
'modules' => [

	'media' => [
		'class' => 'cinghie\media\media',
		'modelMap' => [
			'Media' => 'app\models\media\Media',
			'MediaSettings' => 'app\models\media\MediaSettings',
		]
	]

],

```

Override view example, on components config

```
'components' => [

	'view' => [
		'theme' => [
			'pathMap' => [
				'@cinghie/media/views/default' => '@app/views/media/default',
			],
		],
	],

],

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance53

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![cinghie](https://avatars.githubusercontent.com/u/2445152?v=4)](https://github.com/cinghie "cinghie (136 commits)")

### Embed Badge

![Health badge](/badges/cinghie-yii2-media/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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