PHPackages                             dd/evolutioncms-libraries-ddinstaller - 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. dd/evolutioncms-libraries-ddinstaller

ActiveModxevo-library[Utility &amp; Helpers](/categories/utility)

dd/evolutioncms-libraries-ddinstaller
=====================================

The library for install and update snippets, plugins and libraries.

0.3.0(1y ago)02PHPPHP &gt;=7.4.0

Since Apr 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DivanDesign/EvolutionCMS.libraries.ddInstaller)[ Packagist](https://packagist.org/packages/dd/evolutioncms-libraries-ddinstaller)[ RSS](/packages/dd-evolutioncms-libraries-ddinstaller/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

(MODX)EvolutionCMS.libraries.ddInstaller
========================================

[](#modxevolutioncmslibrariesddinstaller)

The library for installing and updating snippets, plugins, and libraries from GitHub repositories.

How it works
------------

[](#how-it-works)

### Terms

[](#terms)

- “Site” — your site.
- “Resource” — snippet, plugin or library that you want to install or update.

### Algorithm

[](#algorithm)

1. First, the library downloads the repository archive of Resource from GitHub using API and temporary saves it in `assets/cache/ddInstaller/`.
2. Then it decides whether to install / update Resource or not.
    To do this it looks at the `composer.json` file from the archive and compares with `composer.json` of Resource on your Site:
    - Resource will be installed or updated if:
        1. `composer.json` in the archive:
            - Is exist.
            - And not empty.
            - And contains the valid `version` field.
        2. `composer.json` on Site:
            - Is not exist.
            - Or empty.
            - Or doesn't contain the `version` field.
            - Or the `version` field is invalid.
        3. `version` in the archive &gt; `version` on Site.
    - Otherwise, Resource will not be installed.
3. To avoid accumulation of trash files, the library removes the existing Resource folder before installation and creates it again (e. g. `assets/snippets/ddGetDate/`).
4. If Resource is a snippet or plugin, the library tries to find its DB file (e. g. `ddGetDate_snippet.php`) and installs / upates it to DB.
5. Finally, the library copies remaining files and subfolders to the Resource folder.

Requires
--------

[](#requires)

- PHP &gt;= 7.4
- [(MODX)EvolutionCMS](https://github.com/evolution-cms/evolution) &gt;= 1.1
- [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.ru/modx/ddtools) &gt;= 0.62
- [(MODX)EvolutionCMS.snippets.ddMakeHttpRequest](https://code.divandesign.ru/modx/ddmakehttprequest) &gt;= 2.3

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

[](#installation)

Elements → Manage Files:

1. Create a new folder `assets/libs/ddInstaller/`.
2. Extract the archive to the folder.

Parameters description
----------------------

[](#parameters-description)

### `\DDInstaller::install($params)`

[](#ddinstallerinstallparams)

Installs or updates needed snippet, plugin, or library.

- `$params`

    - Description: Parameters, the pass-by-name style is used.
    - Valid values:
        - `arrayAssociative`
        - `object`
        - `stringJsonObject` — as [JSON](https://en.wikipedia.org/wiki/JSON)
        - `stringHjsonObject` — as [HJSON](https://hjson.github.io/)
        - `stringQueryFormatted` — as [Query string](https://en.wikipedia.org/wiki/Query_string)
    - **Required**
- `$params->url`

    - Description: Resource GitHub URL.
        - E. g. `'https://github.com/DivanDesign/EvolutionCMS.snippets.ddGetDate'`
    - Valid values: `stringUrl`
    - **Required**
- `$params->revision`

    - Description: The branch name, tag name, or commit hash to retrieve.
        - If you specify anything other than `'master'` or any version tag, the distributive will be installed regardless of the `composer.json` version. This is useful for installing developer versions.
    - Valid values: `string`
    - Default value: `'master'`
- `$params->type`

    - Description: Resource type.
        - The parameter is case insensitive.
        - If `$params->url` contain the following words, you can avoid this parameter and the method will detect type automatically:
            - `'snippet'`, `'snippets'` — `'snippet'`
            - `'plugin'`, `'plugins'` — `'plugin'`
            - `'library'`, `'libraries'` — `'library'`
    - Valid values:
        - `'snippet'`
        - `'plugin'`
        - `'library'`
        - any empty value — will be auto detected from `$params->url`
    - Default value: —

#### Returns

[](#returns)

- `$result`
    - Description: Installation status.
    - Valid values:
        - `true` — if the resource is installed or updated successfully
        - `false` — if something went wrong or the resource on Site is already up to date

Examples
--------

[](#examples)

### Install or update the `ddGetDate` snippet

[](#install-or-update-the-ddgetdate-snippet)

Just run the following PHP code in your sources or [Console](https://github.com/vanchelo/MODX-Evolution-Ajax-Console):

```
// Include (MODX)EvolutionCMS.libraries.ddInstaller
require_once(
	$modx->getConfig('base_path')
	. 'assets/libs/ddInstaller/require.php'
);

// Install (MODX)EvolutionCMS.snippets.ddGetDate
\DDInstaller::install([
	'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddGetDate',
]);
```

- If `ddGetDate` is not exist on your Site, the library will just install it.
- If `ddGetDate` is already exist on your Site, the library will check it version and update it if needed.

Links
-----

[](#links)

- [Telegram chat](https://t.me/dd_code)
- [Packagist](https://packagist.org/packages/dd/evolutioncms-snippets-ddinstaller)
- [GitHub](https://github.com/DivanDesign/EvolutionCMS.libraries.ddInstaller)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~442 days

Total

4

Last Release

530d ago

PHP version history (2 changes)0.1PHP &gt;=5.6.0

0.2.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/09b81986267e62b5fde1473b40aa6f11f7bc26c1c29d5f80f2768c8788e08110?d=identicon)[dd](/maintainers/dd)

---

Top Contributors

[![Ronef](https://avatars.githubusercontent.com/u/1333424?v=4)](https://github.com/Ronef "Ronef (27 commits)")

---

Tags

installermodxMODX Evoevoupdaterevolution-cmsmodx evolutionevo cmsevolutioncmsdivandesigndd studiodd groupddinstallerinstall snippetinstall plugininstall libraryinstall libupdate snippetupdate pluginupdate libraryupdate lib

### Embed Badge

![Health badge](/badges/dd-evolutioncms-libraries-ddinstaller/health.svg)

```
[![Health](https://phpackages.com/badges/dd-evolutioncms-libraries-ddinstaller/health.svg)](https://phpackages.com/packages/dd-evolutioncms-libraries-ddinstaller)
```

PHPackages © 2026

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