PHPackages                             inspiredminds/contao-file-usage - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. inspiredminds/contao-file-usage

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

inspiredminds/contao-file-usage
===============================

Contao extension that allows you to search for references of files in the database assisted file manager.

3.2.7(3mo ago)1212.7k↓38.7%3[1 issues](https://github.com/inspiredminds/contao-file-usage/issues)9LGPL-3.0-or-laterPHPPHP &gt;=8.2

Since Feb 13Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/inspiredminds/contao-file-usage)[ Packagist](https://packagist.org/packages/inspiredminds/contao-file-usage)[ Docs](https://github.com/inspiredminds/contao-file-usage)[ GitHub Sponsors](https://github.com/sponsors/fritzmg)[ RSS](/packages/inspiredminds-contao-file-usage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (31)Used By (9)

[![](https://camo.githubusercontent.com/43a4c2363b0bd3510bcd5c2ffab063659654717d726cd28c0984fb8734dbde4b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e7370697265646d696e64732f636f6e74616f2d66696c652d75736167652e737667)](https://packagist.org/packages/inspiredminds/contao-file-usage)[![](https://camo.githubusercontent.com/16c42790ed66570e183404406e66f873a245c8fc5258cf053e57fe81bdb4f4b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e7370697265646d696e64732f636f6e74616f2d66696c652d75736167652e737667)](https://packagist.org/packages/inspiredminds/contao-file-usage)

Contao File Usage
=================

[](#contao-file-usage)

This Contao extension allows you to find and display file references of your files managed by the file manager. For each file in the file manager there will be a new operation ([![search](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/public/search.svg)](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/public/search.svg) or [![link](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/public/link.svg)](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/public/link.svg)).

[![File manager](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/filemanager.png)](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/filemanager.png)

This operation will then show you any references of this file that this extension finds in the database, with links to the original data record, if available.

[![References](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/references.png)](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/references.png)

The search results are cached indefinitely. You can force to fetch new search results with the *Refresh* button. However, depending on the size of your database this might take a while and might not be able to finish within the HTTP request. In this case you will need to rely on the [cronjob](#cronjob) or [command](#command).

You can also use the "Unused files" global operation in order to find any database assisted files that aren't referenced anywhere (at least according to the search results).

[![Unused files](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/unused.png)](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/unused.png)

File Replacements
-----------------

[](#file-replacements)

This extension also replaces Contao's `fileTree` widget with its own implementation, showing an additional button with which you can replace the file references found for this file with a new reference.

[![Gallery](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/gallery.png)](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/gallery.png)

[![Replace references](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/replace.png)](https://raw.githubusercontent.com/inspiredminds/contao-file-usage/master/replace.png)

Cronjob
-------

[](#cronjob)

As previously mentioned the search results are cached. In order for the cache to always be up to date for at least 24 hours this extension implements a daily cronjob. However, the cronjob is only run on the command line interface, so make sure that you have set up [Contao's cronjob](https://docs.contao.org/dev/framework/cron/)accordingly.

Command
-------

[](#command)

You can also warm up the file usage result cache from the command line, using the `contao_file_usage:warmup` command.

Custom Providers
----------------

[](#custom-providers)

Currently this extension can find any references created by the `fileTree` input field of any (database based) DCA and it can find any references from `{{file::*}}`, `{{picture::*}}` and `{{figure::*}}` insert tags in any text based fields in the database. It can also find `src="…"` references in the database where only the path is used in `textarea` fields. If you want to expand this search to other locations you can implement your own *file usage provider* by implementing the `FileUsageProviderInterface`.

```
// src/FileUsage/FoobarProvider.php
use InspiredMinds\ContaoFileUsage\Provider\FileUsageProviderInterface;
use InspiredMinds\ContaoFileUsage\Result\DatabaseReferenceResult;
use InspiredMinds\ContaoFileUsage\Result\ResultsCollection;

class FoobarProvider implements FileUsageProviderInterface
{
    public function find(): ResultsCollection
    {
        $collection = new ResultsCollection();

        // Additional database search
        // …

        $collection->addResult(new DatabaseReferenceResult($table, $field, $id));

        return $collection;
    }
}
```

That is all you need to do, if you enabled `autoconfigure` for your service. Otherwise you will also need to tag the service with `contao_file_usage.provider` manually.

You might want or need to implement a new result container using the `ResultInterface` for your purposes (e.g. if your provider looks in the contents of files, rather than the database for example, which this extension currently does not do by default). In your interface you will need to reference the Twig template that should be used when rendering the result in the back end:

```
// src/FileUsage/CustomFileUsageResult.php
use InspiredMinds\ContaoFileUsage\Result\ResultInterface;

class CustomFileUsageResult implements ResultInterface
{
    public function __construct(
        // Your result data
    ) {
    }

    public function getTemplate(): string
    {
        return '@Foobar/my_file_usage_result.html.twig';
    }
}
```

See [here](https://packagist.org/packages/inspiredminds/contao-file-usage/dependents?order_by=name) for possible further examples.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance80

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 88.7% 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 ~37 days

Recently: every ~54 days

Total

30

Last Release

95d ago

Major Versions

1.1.5 → 2.0.02023-03-18

2.3.3 → 3.0.02024-11-04

PHP version history (4 changes)1.0.0PHP &gt;=7.1

2.0.0PHP &gt;=7.4

3.1.0PHP &gt;=8.1

3.2.6PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/25f6ec05570f72d0fcc4d0a4fef2309799d53badf8b30484284e73724661e0d8?d=identicon)[fritzmg](/maintainers/fritzmg)

---

Top Contributors

[![fritzmg](https://avatars.githubusercontent.com/u/4970961?v=4)](https://github.com/fritzmg "fritzmg (63 commits)")[![zonky2](https://avatars.githubusercontent.com/u/1045318?v=4)](https://github.com/zonky2 "zonky2 (4 commits)")[![bytehead](https://avatars.githubusercontent.com/u/754921?v=4)](https://github.com/bytehead "bytehead (2 commits)")[![akroii](https://avatars.githubusercontent.com/u/8830861?v=4)](https://github.com/akroii "akroii (1 commits)")[![zoglo](https://avatars.githubusercontent.com/u/55794780?v=4)](https://github.com/zoglo "zoglo (1 commits)")

### Embed Badge

![Health badge](/badges/inspiredminds-contao-file-usage/health.svg)

```
[![Health](https://phpackages.com/badges/inspiredminds-contao-file-usage/health.svg)](https://phpackages.com/packages/inspiredminds-contao-file-usage)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

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

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

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

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

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[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)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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