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.

4.0.0(1mo ago)1215.2k↓53.6%4[1 issues](https://github.com/inspiredminds/contao-file-usage/issues)[2 PRs](https://github.com/inspiredminds/contao-file-usage/pulls)9LGPL-3.0-or-laterPHPPHP &gt;=8.2

Since Feb 13Pushed 1mo 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 2w ago

READMEChangelog (10)Dependencies (37)Versions (33)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.

Ignoring Tables
---------------

[](#ignoring-tables)

Since version `4.0.0` you can configure the database tables to be ignored for the build int database providers, when searching for file references:

```
# config/config.yaml
contao_file_usage:
    ignore_tables:
        - tl_version
        - tl_log
        - tl_undo
        - tl_search_index
        - tl_message_queue
```

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance88

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community26

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~39 days

Recently: every ~77 days

Total

32

Last Release

55d ago

Major Versions

1.1.5 → 2.0.02023-03-18

2.3.3 → 3.0.02024-11-04

3.2.8 → 4.0.02026-06-26

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 (66 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)")[![luhmannAlexander](https://avatars.githubusercontent.com/u/45062863?v=4)](https://github.com/luhmannAlexander "luhmannAlexander (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/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M676](/packages/shopware-core)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M430](/packages/easycorp-easyadmin-bundle)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[chameleon-system/chameleon-base

The Chameleon System core.

1029.4k6](/packages/chameleon-system-chameleon-base)[sulu/sulu

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

1.3k1.4M236](/packages/sulu-sulu)[shopware/storefront

Storefront for Shopware

674.7M287](/packages/shopware-storefront)

PHPackages © 2026

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