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

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

sourcebroker/deployer-extended-media
====================================

Deployer tasks to manage media synchronization between application instances.

14.0.0(1y ago)9280.8k—1.5%7[1 issues](https://github.com/sourcebroker/deployer-extended-media/issues)7MITPHP

Since Jun 16Pushed 1y ago3 watchersCompare

[ Source](https://github.com/sourcebroker/deployer-extended-media)[ Packagist](https://packagist.org/packages/sourcebroker/deployer-extended-media)[ RSS](/packages/sourcebroker-deployer-extended-media/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (24)Used By (7)

deployer-extended-media
=======================

[](#deployer-extended-media)

[![https://img.shields.io/packagist/v/sourcebroker/deployer-extended-media.svg?style=flat](https://camo.githubusercontent.com/1a39a9b7fcfc36e614fb884287f59cc2332af96b1d2919ccaa97ea27de5a8f97/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f7572636562726f6b65722f6465706c6f7965722d657874656e6465642d6d656469612e7376673f7374796c653d666c6174)](https://packagist.org/packages/sourcebroker/deployer-extended-media)[![https://img.shields.io/badge/license-MIT-blue.svg?style=flat](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://packagist.org/packages/sourcebroker/deployer-extended-media)

- [What does it do?](#what-does-it-do)
- [How this can be useful for me?](#how-this-can-be-useful-for-me)
- [Installation](#installation)
- [Options](#options)
- [Tasks](#tasks)
    - [media:copy](#media-copy)
    - [media:link](#media-link)
    - [media:pull](#media-pull)
    - [media:push](#media-push)
- [Managing the media config](#managing-the-media-config)
    - [Examples of config final tunning](#examples-of-config-final-tunning)
- [Changelog](#changelog)

[What does it do?](#id1)
------------------------

[](#what-does-it-do)

The package provides additional tasks for deployer (deployer.org) for synchronizing media between instances.

[How this can be useful for me?](#id2)
--------------------------------------

[](#how-this-can-be-useful-for-me)

The most useful is `dep media:pull [source]` task which allows you to pull media from source instance to current instance with rsync.

There are also two additional useful tasks which allows to copy or symlink media between remote instances. For example you can use `dep media:link [source] --options=target:[target]` to create symlinks for each single file (equivalent of cp -Rs).

[Installation](#id3)
--------------------

[](#installation)

1. Install package with composer:

    ```
    composer require sourcebroker/deployer-extended-media
    ```
2. If you are using deployer as composer package then just put following line in your deploy.php:

    ```
    new \SourceBroker\DeployerLoader\Load([['path' => 'vendor/sourcebroker/deployer-extended-media/deployer']]);
    ```
3. If you are using deployer as phar then put following lines in your deploy.php:

    ```
    require_once(__DIR__ . '/vendor/sourcebroker/deployer-loader/autoload.php');
    new \SourceBroker\DeployerLoader\Load([['path' => 'vendor/sourcebroker/deployer-extended-media/deployer']]);
    ```

    IMPORTANT NOTE!

    Do not put `require('/vendor/autoload.php')` inside your deploy.php because you can have dependency problems. Use `require_once(__DIR__ . '/vendor/sourcebroker/deployer-loader/autoload.php');` instead as suggested.
4. In deploy.php set the folders you want to synchronize:

    ```
    set('media_custom',
        [
         'filter' => [
             '+ /public/',
             '+ /public/fileadmin/',
             '- /public/fileadmin/_processed_/*',
             '+ /public/fileadmin/**',
             '+ /public/uploads/',
             '+ /public/uploads/**',
             '- *'
        ]
    ]);
    ```
5. Run the task:

    ```
    dep media:pull [source]
    ```

[Options](#id4)
---------------

[](#options)

- **exclude**

    *default value:* null

    Array with patterns to be excluded.
- **exclude-case-insensitive**

    *default value:* null

    Array with patterns to be excluded. Because rsync does not support case insensitive then each value of array is set in state uppercase/lowercase. That means if you will have `['*.mp4', '*.zip']`then final exclude will be `--exclude '*.[mM][pP]4' --exclude '*.[zZ][iI][pP]'`
- **exclude-file**

    *default value:* null

    String containing absolute path to file, which contains exclude patterns.
- **include**

    *default value:* null

    Array with patterns to be included.
- **include-file**

    *default value:* null

    String containing absolute path to file, which contains include patterns.
- **filter**

    *default value:* null

    Array of rsync filter rules
- **filter-file**

    *default value:* null

    String containing merge-file filename.
- **filter-perdir**

    *default value:* null

    String containing merge-file filename to be scanned and merger per each directory in rsync list offiles to send.
- **flags**

    *default value:* rz

    Flags added to rsync command.
- **options**

    *default value:* ['copy-links', 'keep-dirlinks', 'safe-links']

    Array of options to be added to rsync command.
- **timeout**

    *default value:* 0

    Timeout for rsync task. Zero means no timeout.

Default configuration for task:

```
set('media_default',
 [
     'exclude' => [],
     'exclude-case-insensitive' => [
         '*.mp4',
         '*.zip',
         '*.pdf',
         '*.exe',
         '*.doc',
         '*.docx',
         '*.pptx',
         '*.ppt',
         '*.xls',
         '*.xlsx',
         '*.xlsm',
         '*.tiff',
         '*.tif',
         '*.potx',
         '*.mpg',
         '*.mp3',
         '*.avi',
         '*.wmv',
         '*.flv',
         '*.eps',
         '*.ai',
         '*.mov',
     ],
     'exclude-file' => false,
     'include' => [],
     'include-file' => false,
     'filter' => [],
     'filter-file' => false,
     'filter-perdir' => false,
     'flags' => 'rz',
     'options' => ['copy-links', 'keep-dirlinks', 'safe-links'],
     'timeout' => 0,
 ]);
```

In your deploy.php you should set `media_custom` which will be merged with `media_default` configuration. See "Managing the media config" section to know how to set `media_custom` configuration.

[Tasks](#id5)
-------------

[](#tasks)

### [media:copy](#id6)

[](#mediacopy)

Copy media between (remote) instances.

```
dep media:copy [source] --options=target:[target]
```

Commands are executed on target remote instance. If instances are placed on the same remote server then rsync on local files are called. If instances are placed on different remote servers then `media:pull [source]` is executed on target instance.

Copy to instance defined in `instance_live_name` (default `live`) is special case. If you copy to highest instance then by default you will be asked twice if you really want to. You can disable asking by setting `media_allow_copy_live_force` to `true`. You can also forbid coping to live instance by setting `media_allow_copy_live` to `false`.

Example: `dep media:copy live --options=target:beta`

### [media:link](#id7)

[](#medialink)

Only for remote instances placed on same machine. Command creates symbolic links on target instance pointing to files on source machine.

```
media:link [source] --options=target:[target]
```

For each file from source instance that does not exist on target instance: 1. Create directory tree recursively. 2. Symlink to file from source instance.

So each file on target instance may be modified / deleted without effect on source.

Linking to instance defined in `instance_live_name` (default `live`) is special case. If you link to highest instance then by default you will be asked twice if you really want to. You can disable asking by setting `media_allow_link_live_force` to `true`. You can also forbid linking to live instance by setting `media_allow_link_live` to `false`.

Example: `dep media:link live --options=target:beta`

### [media:pull](#id8)

[](#mediapull)

Pull media from source instance to current instance using rsync and options from media config.

```
dep media:pull [source]
```

Example: `dep media:pull live`

Pulling to instance defined in `instance_live_name` (default `live`) is special case. If you pull to highest instance then by default you will be asked twice if you really want to. You can disable asking by setting `media_allow_pull_live_force` to `true`. You can also forbid pulling to live instance by setting `media_allow_pull_live` to `false`.

### [media:push](#id9)

[](#mediapush)

Pull media from current instance to target instance using rsync and options from media config.

```
dep media:push [target]
```

Pushing to instance defined in `instance_live_name` (default `live`) is special case. If you push to highest instance then by default you will be asked twice if you really want to. You can disable asking by setting `media_allow_push_live_force` to `true`. You can also forbid pushing to live instance by setting `media_allow_push_live` to `false`.

Example: `dep media:push beta`

[Managing the media config](#id10)
----------------------------------

[](#managing-the-media-config)

The final media config is result of merging three arrays:- `media_default` (from deployer-extended-media)
- `media` (from deployer-extended-typo3)
- `media_custom` (from user's deploy.php file)

The merging function has some special features:

1. A special `__UNSET` notation is used to remove specific items from array during the merging process.
2. An empty array will overwrite the array we merge to.

### [Examples of config final tunning](#id11)

[](#examples-of-config-final-tunning)

**Example 1: Removing a specific option**

```
set('media_custom', [
    'options' => [
        '__UNSET' => ['safe-links'],
    ],
]);
```

In the above example, if `options` in the `media_default` array contained `['copy-links', 'safe-links']`, after the merge with `media_custom`, `options` would contain only `['copy-links']`.

**Example 2: Removing specific file types from exclusion**

```
set('media_custom', [
    'exclude-case-insensitive' => [
        '__UNSET' => ['*.pdf', '*.exe'],
    ],
]);
```

In this example, `*.pdf` and `*.exe` are removed from the list of case-insensitive excluded file types.

**Example 3: Completely clearing an array and adding one new option**

```
set('media_custom', [
    'exclude-case-insensitive' => [
        '__UNSET' => get('media_default')['exclude-case-insensitive'],
        '*.mp4'
    ],
]);
```

In this example, `__UNSET` is used to completely clear the `exclude` array in the `media_default` settings and add only `*.mp4`.

If you want only to clear you can just set empty array:

```
set('media_custom', [
    'exclude-case-insensitive' => []
]);
```

**Example 4: Extend existing filter config**

```
set('media_custom', [
    'filter' => [
        '__UNSET' => ['- *'],
        '+ /' . get('web_path') . 'public/pim/',
        '+ /' . get('web_path') . 'public/pim/**',
        '- *',
    ],
]);
```

In this example, `__UNSET` is used to remove `- *` option from filter array, then adding `public/pim` folder for synchronising. Finally putting `- *` at end of filter array.

[Changelog](#id12)
------------------

[](#changelog)

See

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance44

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 98.8% 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 ~129 days

Recently: every ~164 days

Total

23

Last Release

408d ago

Major Versions

9.0.0 → 10.0.02022-12-11

10.0.0 → 11.0.02022-12-28

11.0.1 → 12.0.02023-06-17

12.0.1 → 13.0.02025-02-22

13.1.0 → 14.0.02025-04-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/6066d053dfdc12f5a676444f6a40b5b7d0b5a112e0ab746c8b04f4a7201b0624?d=identicon)[sourcebroker](/maintainers/sourcebroker)

---

Top Contributors

[![kszymukowicz](https://avatars.githubusercontent.com/u/1453553?v=4)](https://github.com/kszymukowicz "kszymukowicz (84 commits)")[![blankse](https://avatars.githubusercontent.com/u/998558?v=4)](https://github.com/blankse "blankse (1 commits)")

---

Tags

deployerdeploymentsinstancesphprsyncsb-demsynchronizationsynchronizationmediadeployer

### Embed Badge

![Health badge](/badges/sourcebroker-deployer-extended-media/health.svg)

```
[![Health](https://phpackages.com/badges/sourcebroker-deployer-extended-media/health.svg)](https://phpackages.com/packages/sourcebroker-deployer-extended-media)
```

###  Alternatives

[essence/essence

Extracts information about medias on the web, like youtube videos, twitter statuses or blog articles.

770562.9k3](/packages/essence-essence)[s9e/text-formatter

Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding third-party media (YouTube, etc...), enhanced typography and more.

2413.1M29](/packages/s9e-text-formatter)[sourcebroker/deployer-extended-database

Deployer tasks to manage database synchronization between application instances.

41302.6k7](/packages/sourcebroker-deployer-extended-database)[dereuromark/media-embed

A PHP library to deal with all those media services around, parsing their URLs and embedding their audio/video content in websites.

182530.3k11](/packages/dereuromark-media-embed)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[classic-o/nova-media-library

Tool and field that will let you managing files and add them to the posts

154172.0k](/packages/classic-o-nova-media-library)

PHPackages © 2026

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