PHPackages                             prestashop/module-lib-mbo-installer - 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. prestashop/module-lib-mbo-installer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

prestashop/module-lib-mbo-installer
===================================

A helper to ease the download PS MBO from the Addons Marketplace

v3.0.0(1y ago)337.8k↓26%2[3 PRs](https://github.com/PrestaShopCorp/module-lib-mbo-installer/pulls)1AFL-3.0PHPPHP &gt;=5.6CI passing

Since Feb 6Pushed 3mo ago13 watchersCompare

[ Source](https://github.com/PrestaShopCorp/module-lib-mbo-installer)[ Packagist](https://packagist.org/packages/prestashop/module-lib-mbo-installer)[ RSS](/packages/prestashop-module-lib-mbo-installer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (9)Used By (1)

PrestaShop module dependencies library
======================================

[](#prestashop-module-dependencies-library)

The goal of this package is to help managing module dependencies.

Let's explain it with an actual case

Supposing our module needs modules A and B to work properly.

We will have to install this `module-lib-mbo-installer` and have a file named `module_dependencies.json` in the root folder of our module containing

```
{
    "dependencies": [
      {
        "name" : "A"
      },
      {
        "name" : "B"
      }
    ]
}

```

The lib will start by checking if [PS MBO (Marketplace in the Back Office)](https://github.com/PrestaShopCorp/ps_mbo) is installed and enabled.

MBO needs to be installed first because we download other modules from the marketplace.

Then it will check for the modules A and B

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

[](#installation)

```
composer require prestashop/module-lib-mbo-installer

```

Version Guidance
----------------

[](#version-guidance)

VersionStatusPackagist -NamespaceRepoDocsPHP Version3.xLatest`prestashop/module-lib-mbo-installer``Prestashop\ModuleLibMboInstaller`[main](https://github.com/PrestaShopCorp/module-lib-mbo-installer/tree/main)N/A&gt;=5.62.xUnmaintained`prestashop/module-lib-mbo-installer``Prestashop\ModuleLibMboInstaller`[v2.0.0](https://github.com/PrestaShopCorp/module-lib-mbo-installer/tree/v2.0.0)N/A&gt;=7.21.xUnmaintained`prestashop/module-lib-mbo-installer``Prestashop\ModuleLibMboInstaller`[v1.0.0](https://github.com/PrestaShopCorp/module-lib-mbo-installer/tree/v1.0)N/A&gt;=5.6Usage
-----

[](#usage)

You have 2 methods available

- DependenciesBuilder::handleDependencies() : this method will return you the status of all the dependencies, including MBO, in an array

```
[
    'module_display_name' => string // your displayed module name
    'module_name' => string // your module tech name
    'module_version' => string
    'ps_version' => string
    'php_version' => string
    'locale' => string // the shop locale
    'dependencies' => [ // an array of all the dependencies defined + MBO
        [
            'name' => 'ps_mbo'
            'installed' => bool
            'enabled' => bool
            'current_version' => string
            'install' => string // route to install the module, if relevant
            'enable' => string  // route to enable the module, if relevant
            'upgrade' => string  // route to upgrade the module, if relevant
        ],
        [
            'name' => string // a dependent module
            'installed' => bool
            'enabled' => bool
            'current_version' => string
            'install' => string // route to install the module, if relevant
            'enable' => string  // route to enable the module, if relevant
            'upgrade' => string  // route to upgrade the module, if relevant
        ],
        ...
    ]
];
```

- DependenciesBuilder::areDependenciesMet() : this method will return you whether all the dependencies, including MBO, are installed and enabled

These 2 methods will help you gather informations about your dependencies and allow you to perform actions to resolve them.

### Examples of implementation

[](#examples-of-implementation)

In most of the cases you'll want to show the dependencies of your module in the configuration page, to allow the "user" to fix them

You can use one of the examples above in the `getContent` method of your module's main file

#### Use the given public CDC

[](#use-the-given-public-cdc)

In your module

```
$mboInstaller = new Prestashop\ModuleLibMboInstaller\DependencyBuilder($this);
$dependencies = $mboInstaller->handleDependencies();

$this->smarty->assign('dependencies', $dependencies);

return $this->display(__FILE__, 'views/templates/admin/dependency_builder.tpl');
```

In the template

```

  const renderMboCdcDependencyResolver = window.mboCdcDependencyResolver.render
  const context = {
    ...{$dependencies|json_encode},
    onDependenciesResolved: () => console.log('Everything works!'),
    onDependencyResolved: (dependencyData) => console.log('Dependency installed', dependencyData), // name, displayName, version
    onDependencyFailed: (dependencyData) => console.log('Failed to install dependency', dependencyData),
    onDependenciesFailed: () => console.log('There are some errors'),
  }
  renderMboCdcDependencyResolver(context, '#cdc-container')

```

This example uses our public CDC which will display a page with the status of the dependencies and an action button to resolve them all

[![Dependencies lib CDC](./docs/modules_to_activate.png)](./docs/modules_to_activate.png)

#### Do it yourself

[](#do-it-yourself)

In your module

```
$mboInstaller = new Prestashop\ModuleLibMboInstaller\DependencyBuilder($this);
$dependencies = $mboInstaller->handleDependencies();

return $this->render(
    '@Modules/examplemodule/views/templates/admin/dependency_builder.html.twig',
    [
        'dependencies' => $dependencies,
    ]
);
```

In the template

```

    $(document).on('click', '.module_action', function(event) {
        event.preventDefault();
        const moduleName = window.$(this).attr('data-module')
        window.$.ajax({
            method: 'POST',
            url: window.$(this).attr('data-url'),
        }).done((response) => {
            console.log(response[moduleName])
            if (response[moduleName].status === true) {
                window.$.growl.notice({message: response[moduleName].msg});
                window.location.reload();
            } else {
                window.$.growl.error({message: response[moduleName].msg});
            }
        });
    })

```

```
{% for dependency in dependencies.dependencies %}

        {{ dependency.name }} :
        {% if dependency.installed is same as(true) and dependency.enabled is same as(true) %}
            OK
        {% elseif dependency.installed is same as(false) and dependency.install is defined %}

              Install

        {% elseif dependency.enable is defined %}

              Enable

        {% else %}
            NOK
        {% endif %}

{% endfor%}
```

The module [builtforjsexample](https://github.com/PrestaShopCorp/builtforjsexample/releases) is an example of integration of MBO installer, where the steps previously detailed have been applied.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance63

Regular maintenance activity

Popularity34

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~250 days

Total

4

Last Release

448d ago

Major Versions

v0.1 → v1.0.02023-12-05

v1.0.0 → v2.0.02023-12-05

v2.0.0 → v3.0.02025-02-24

PHP version history (2 changes)v0.1PHP &gt;=5.6

v2.0.0PHP &gt;=7.2.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15106407?v=4)[Jarvis](/maintainers/ps-jarvis)[@ps-jarvis](https://github.com/ps-jarvis)

---

Top Contributors

[![Quetzacoalt91](https://avatars.githubusercontent.com/u/6768917?v=4)](https://github.com/Quetzacoalt91 "Quetzacoalt91 (21 commits)")[![Poulinhoo](https://avatars.githubusercontent.com/u/22856724?v=4)](https://github.com/Poulinhoo "Poulinhoo (7 commits)")[![cdesiles](https://avatars.githubusercontent.com/u/1536672?v=4)](https://github.com/cdesiles "cdesiles (5 commits)")[![Mikatux](https://avatars.githubusercontent.com/u/6116145?v=4)](https://github.com/Mikatux "Mikatux (4 commits)")[![sowbiba](https://avatars.githubusercontent.com/u/7426640?v=4)](https://github.com/sowbiba "sowbiba (3 commits)")[![intraordinaire](https://avatars.githubusercontent.com/u/1721887?v=4)](https://github.com/intraordinaire "intraordinaire (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/prestashop-module-lib-mbo-installer/health.svg)

```
[![Health](https://phpackages.com/badges/prestashop-module-lib-mbo-installer/health.svg)](https://phpackages.com/packages/prestashop-module-lib-mbo-installer)
```

###  Alternatives

[zachleigh/laravel-vue-generators

Generate Vue js files via artisan commands.

9039.6k](/packages/zachleigh-laravel-vue-generators)[gdarko/wp-batch-processing

Easily process large batches of data in WordPress. Provide the data, setup the processing procedure, run the batch processor from the admin dashboard. Profit.

1295.5k](/packages/gdarko-wp-batch-processing)

PHPackages © 2026

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