PHPackages                             moodle/moodle-composer-scaffold - 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. moodle/moodle-composer-scaffold

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

moodle/moodle-composer-scaffold
===============================

A scaffolding tool for Composer-based Moodle installations

v1.0.3(3mo ago)14.2k↓24.3%1[1 PRs](https://github.com/moodle/moodle-composer-scaffold/pulls)3GPL-3.0-or-laterPHPPHP &gt;=8.2.0CI passing

Since Jan 5Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/moodle/moodle-composer-scaffold)[ Packagist](https://packagist.org/packages/moodle/moodle-composer-scaffold)[ RSS](/packages/moodle-moodle-composer-scaffold/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (8)Used By (3)

Moodle Composer Scaffolding system
==================================

[](#moodle-composer-scaffolding-system)

The Moodle Composer Scaffolder is a Composer Plugin intended to simplify and easy the installation of Moodle as a Composer project.

This tooling will:

- Generate a Moodle configuration file
- Support the generation of Configuration for Moodle
- Assist with the installation of Moodle

Files generated
---------------

[](#files-generated)

### The Moodle configuration

[](#the-moodle-configuration)

This tooling will guide you through the creation of a configuration file for Moodle which sits alongside your `composer.json`.

#### Placeholders

[](#placeholders)

The following placeholders may be provided either in response to interactive prompts, or via the environment variable configuration:

PlaceholderMeaningDefault`[NAME]`The name of the siteThe *base name* of the folder that the project is in#### Configuration

[](#configuration)

You can provide a `.env` file in any of the following locations:

- `.env` in your project's root directory
- `.env.local` in your project's root directory
- `.env` in the parent directory of you project
- `.env.local` in the parent directory of you project

The following parameters are accepted:

Environment keyDefaultDescriptionPlaceholdersExample`MOODLE_AGREE_LICENSE``N`Whether you agree to the Moodle GPL License agreement-`Y``MOODLE_ADMIN_PASSWORD`-The admin password to use when installing your site-`password``MOODLE_ADMIN_EMAIL`-The email address of the admin user-`admin@example.com``MOODLE_DB_USERNAME`-The username to use for the database server-`webdev``MOODLE_DB_PASSWORD`-The password to use for the database server-`moodle``MOODLE_DB_HOST`-The hostname to use for the database server-`localhost``MOODLE_DB_NAME``[NAME]`The name of the database to use`[NAME]``[NAME]``MOODLE_DB_PREFIX``mdl_`The database prefix to use-`mdl_``MOODLE_DB_DRIVER`-The database driver to use-`pgsql``MOODLE_WWWROOT`-The URL of the Moodl esite`[NAME]``https://[NAME].example`### Generated files

[](#generated-files)

#### Moodle Configuration - `/config.php`

[](#moodle-configuration---configphp)

The root `/config.php` file stores all of the standard Moodle configuration properties.

This is functionally equivalent to the `config.php` in the standard installation and the values and documentation in `config-dist.php` apply here.

Note: There is no need to manually include the `setup.php` file as in the non-Composer installation method.

This file will only be generated if it does not already exist, but will be attempted on every Composer operation, or whenever the `composer scaffold` or `composer configure` commands are run.

#### Moodle Configuration Shim - `/moodle/config.php`

[](#moodle-configuration-shim---moodleconfigphp)

The scaffolder will create a `config.php` within the Moodle installation directory.

The purpose of this is to act as a shim for parts of Moodle which manually load the configuration file.

It will be generated on every Composer operation, or whenever the `composer scaffold` command is run.

#### Moodle Composer Autoload Shim - `/moodle/vendor/autoload.php`

[](#moodle-composer-autoload-shim---moodlevendorautoloadphp)

The scaffolder will create a `/moodle/vendor/autoload.php` file which will load the Composer Autoload file from the project root.

This is required because in instances where Moodle is symlinked to the target directory (for example when using a Local Composer repository) the symlink source cannot be determined automatically from Moodle.

It will be generated on every Composer operation, or whenever the `composer scaffold` command is run.

#### Moodle Binary Helper - `/msh`

[](#moodle-binary-helper---msh)

For versions of Moodle which support Console commands, a helper is created at `/msh` in the project root to link to the `bin/moodle` within the project root.

It will be generated on every Composer operation, or whenever the `composer scaffold` command is run.

Commands
--------

[](#commands)

The scaffolder includes several commands which can be manually run if required.

### `composer scaffold`

[](#composer-scaffold)

This command will manually run the scaffold system.

Note: This is automatically called as a post-installation step any time that a package is installed or updated.

### `composer configure`

[](#composer-configure)

This command will run the configuration wizard to create an initial manual configuration file.

If a configuration file already exists, it has no effect.

Note: This is automatically called as a post-installation step any time that a package is installed or updated.

References
----------

[](#references)

This plugin was inspired by the Drupal Composer Scaffolder.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance78

Regular maintenance activity

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

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 ~3 days

Total

6

Last Release

117d ago

Major Versions

v0.2.0 → v1.0.02026-01-06

### Community

Maintainers

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

---

Top Contributors

[![andrewnicols](https://avatars.githubusercontent.com/u/370047?v=4)](https://github.com/andrewnicols "andrewnicols (40 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/moodle-moodle-composer-scaffold/health.svg)

```
[![Health](https://phpackages.com/badges/moodle-moodle-composer-scaffold/health.svg)](https://phpackages.com/packages/moodle-moodle-composer-scaffold)
```

###  Alternatives

[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[vaimo/composer-changelogs

Provide information about package changes based on changelog files that are bundled with releases; provide tools for generating documentation files from changelog sources

11150.5k10](/packages/vaimo-composer-changelogs)

PHPackages © 2026

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