PHPackages                             esimonetti/sugar-module-packager - 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. esimonetti/sugar-module-packager

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

esimonetti/sugar-module-packager
================================

Utility to package Sugar customisations into module loadable packages

0.2.3(4y ago)54846[2 issues](https://github.com/esimonetti/sugar-module-packager/issues)[1 PRs](https://github.com/esimonetti/sugar-module-packager/pulls)Apache-2.0PHPPHP &gt;=5.6

Since Feb 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/esimonetti/sugar-module-packager)[ Packagist](https://packagist.org/packages/esimonetti/sugar-module-packager)[ RSS](/packages/esimonetti-sugar-module-packager/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

Sugar Module Packager
=====================

[](#sugar-module-packager)

There are two options to start using the Sugar Module Packager:

- Start from the pre-made template (with or without Docker)
- Start from scratch by requiring the composer library (with or without Docker)

Docker
------

[](#docker)

If you have Docker installed, you can conveniently run the following commands

### New package - Start from pre-made template

[](#new-package---start-from-pre-made-template)

```
mkdir my-module
cd my-module
docker run -it -v ${PWD}:/usr/src/packager -w /usr/src/packager esimonetti/sugarmodulepackager template

```

### New package - Start from scratch

[](#new-package---start-from-scratch)

```
mkdir my-module
cd my-module
docker run -it -v ${PWD}:/usr/src/packager -w /usr/src/packager esimonetti/sugarmodulepackager new

```

### Packaging of code

[](#packaging-of-code)

After the Sugar Module Packager has been installed successfully, it is possible to package your code (through Docker) by executing: `./vendor/bin/package-docker ` ie: `./vendor/bin/package-docker 1.6`

Manual Approach
---------------

[](#manual-approach)

Alternatively to Docker, it is possible to proceed with the manual approach

### New package - Start from pre-made template

[](#new-package---start-from-pre-made-template-1)

Visit  and follow the instructions

### New package - Start from scratch

[](#new-package---start-from-scratch-1)

Require the composer library within your module's source directory by executing: `composer require esimonetti/sugar-module-packager 0.2.3`

The .gitignore should look like the following:

```
composer.lock
/vendor/
/pkg/
/releases/

```

### Packaging of code

[](#packaging-of-code-1)

After the Sugar Module Packager has been installed successfully, it is possible to package your code (without Docker) by executing: `./vendor/bin/package ` ie: `./vendor/bin/package 1.6`

Additional Example
------------------

[](#additional-example)

A simple code example on how to leverage this library can be found on:

Packager Details
----------------

[](#packager-details)

- The `src` directory contains the code that should be copied into the Sugar instance according to their relative path within `src`
    - There are a couple of exceptions: `LICENSE` and `README.txt` files will not be copied into the instance, just into the installable package
- `configuration` directory
    - Must define the `manifest` information on `manifest.php`
    - Optionally, it is possible to define the `installdefs` actions on `installdefs.php`
    - Optionally, for more complex use-cases, it is possible to define code templating actions to be completed by the packager across multiple modules, within the `templates.php` file
        - It is possible to define multiple template sections based on multiple template actions and patterns to replicate across modules
            - The array keys of the templates configuration array define the package directories to read files from, when generating the output
            - The array content defines the `directory_pattern` tree prefix, that will be appendedd as a prefix of every file path of the local directory
                - The string `{MODULENAME}` within the `directory_pattern` templates configuration option, will be replaced with the current module name during package generation
            - The array content defines the `modules` list that must contain the module names as array keys and the object name as array values
                - The string `{MODULENAME}` within your local directory template files, will be replaced during package generation as the configuration's module list array key (the module name, usually plural eg: `Accounts`)
                - The string `{OBJECTNAME}` within your local directory template files, will be replaced during package generation as the configuration's module list array value (the object name of the module, usually singular eg: `Account`)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.2% 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 ~313 days

Total

5

Last Release

1763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e55de787081ffcb4baa0e8f8ac19d960110f5bd30c8b1277b1fff74e7429921c?d=identicon)[esimonetti](/maintainers/esimonetti)

---

Top Contributors

[![esimonetti](https://avatars.githubusercontent.com/u/1671865?v=4)](https://github.com/esimonetti "esimonetti (35 commits)")[![atenea-sugarcrm](https://avatars.githubusercontent.com/u/85604748?v=4)](https://github.com/atenea-sugarcrm "atenea-sugarcrm (1 commits)")

---

Tags

sugarsugarcrm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/esimonetti-sugar-module-packager/health.svg)

```
[![Health](https://phpackages.com/badges/esimonetti-sugar-module-packager/health.svg)](https://phpackages.com/packages/esimonetti-sugar-module-packager)
```

###  Alternatives

[jackiedo/dotenv-editor

The .env file editor tool for Laravel 5.8+

2041.2M31](/packages/jackiedo-dotenv-editor)[johnbillion/wp-crontrol

Take control of the cron events on your WordPress website or WooCommerce store

22381.4k1](/packages/johnbillion-wp-crontrol)

PHPackages © 2026

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