PHPackages                             silverstripe/recipe-plugin - 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. silverstripe/recipe-plugin

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

silverstripe/recipe-plugin
==========================

Helper plugin to install SilverStripe recipes

2.1.0(1y ago)102.5M↓14.5%10[4 issues](https://github.com/silverstripe/recipe-plugin/issues)20BSD-3-ClausePHPPHP ^8.1CI passing

Since Jul 11Pushed 1y ago7 watchersCompare

[ Source](https://github.com/silverstripe/recipe-plugin)[ Packagist](https://packagist.org/packages/silverstripe/recipe-plugin)[ RSS](/packages/silverstripe-recipe-plugin/feed)WikiDiscussions 2 Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (21)Used By (20)

Silverstripe recipe-plugin
==========================

[](#silverstripe-recipe-plugin)

[![CI](https://github.com/silverstripe/recipe-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/recipe-plugin/actions/workflows/ci.yml)[![Silverstripe supported module](https://camo.githubusercontent.com/9b7e93d393a01f6d3091fb30983b870aa863ef076858115faaa1c74b995854ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73696c7665727374726970652d737570706f727465642d3030373143342e737667)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)

Introduction
------------

[](#introduction)

This plugin enhances composer and allows for the installation of "silverstripe-recipe" packages. These recipes allow for the following features:

- The ability to provide project resource files. These are copied to the appropriate project root location on install, and can be safely modified by the developer. On subsequent updates to a later recipe, composer will inform the user if a project file has been updated, and will ensure new files are copied as they are introduced to the recipe.
- Recipes are composable, so resources or dependencies that are required by multiple recipes can include one another, rather than having to duplicate content.
- Recipes also can be used as a base composer project.
- A `require-recipe` command to inline a recipe into the root composer.json, allowing the developer to customise the recipe dependencies without mandating the inclusion of all requirements directly.
- An `update-recipe` command to upgrade to a newer version of a recipe.

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

[](#installation)

```
composer require silverstripe/recipe-plugin
```

Example output
--------------

[](#example-output)

[![example-output](docs/_images/require-usage.png)](docs/_images/require-usage.png)

Creating a new project
----------------------

[](#creating-a-new-project)

Recipes can be introduced to any existing project (even if not created on a silverstripe base project)

```
composer init
composer require silverstripe/recipe-cms
```

Alternatively you can create a new project based on an existing recipe

```
composer create-project silverstripe/recipe-cms ./myssproject
```

Inlining recipes
----------------

[](#inlining-recipes)

You can "inline" either a previously installed recipe, or a new one that you would like to include dependencies for in your main project. By inlining a recipe, you promote its requirements, as well as its project files, up into your main project, and remove the recipe itself from your dependencies.

This can be done with either `update-recipe`, which will update a recipe, or `require-recipe` which will install a new recipe.

Note that if you wish to run this command you must first install either a recipe via normal composer commands, or install the recipe plugin:

```
composer init
composer require silverstripe/recipe-plugin
composer require-recipe silverstripe/recipe-cms
```

or

```
composer init
composer require silverstripe/recipe-cms
composer update-recipe silverstripe/recipe-cms
```

Removing recipe dependencies or files
-------------------------------------

[](#removing-recipe-dependencies-or-files)

Any project file installed via a recipe, or any module installed by inlining a recipe, can be easily removed. Subsequent updates to this recipe will not re-install any of those files or dependencies.

In order to ensure this, a record of all inlined modules, and all installed files are stored in composer.json as below.

```
{
    "extra": {
        "project-files-installed": [
            "mysite/code/Page.php",
            "mysite/code/PageController.php"
        ],
        "project-dependencies-installed": {
            "silverstripe/admin": "2.0.x-dev",
            "silverstripe/asset-admin": "2.0.x-dev",
        }
    }
}
```

To remove a file, simply delete it from the folder your project is installed in, but don't modify `project-files-installed` (as this is how composer knows what not to re-install).

Likewise to remove a module, use `composer remove ` and it will be removed. As above, don't modify `project-dependencies-instaleld`, otherwise that module will be re-installed on subsequent `composer update-recipe`.

Un-doing a deleted project file / dependency
--------------------------------------------

[](#un-doing-a-deleted-project-file--dependency)

If you have deleted a module or file and want to re-install it you should remove the appropriate entry from either 'project-files-installed' or 'project-dependencies-installed' and then run `composer update-recipe ` again.

The file or module will be re-installed.

Removing recipes
----------------

[](#removing-recipes)

As installation of a recipe inlines all dependencies and passes ownership to the root project, there is no automatic removal process. To remove a recipe, you should manually remove any required module that is no longer desired via `composer remove `.

The `provide` reference to the recipe can also be safely removed, although it has no practical result other than to disable future calls to `update-recipe` on this recipe.

Installing or upgrading recipes without inlining them
-----------------------------------------------------

[](#installing-or-upgrading-recipes-without-inlining-them)

If desired, the optional inline behaviour of recipes can be omitted. Simply use the composer commands `require` and `update` in place of `require-recipe` and `update-recipe` respectively. This will not disable the project files feature, but will not inline the recipe directly, keeping your root composer.json from getting cluttered.

If you have already inlined a recipe, it will be necessary to manually remove any undesired inlined requirements manually, and the recipe will need to be included with `require` subsequently.

Note that using this method it's not necessary to include the `silverstripe/recipe-plugin` in the root project for this to work.

Recipe composer.json schema
---------------------------

[](#recipe-composerjson-schema)

Recipe types should follow the following rules:

- No mandatory resources, other than project files.
- Recipes must not rely on `autoload` as this are discarded on inline. Likewise any `*-dev` or other root-only options should not be used, as these are ignored outside of the root project. The exception to this is when these values are useful as a base project only.
- The `type` must be `silverstripe-recipe`
- The `require` must have `silverstripe/recipe-plugin` as a dependency.
- `extra.project-files` must be declared as a list of wildcard patterns, matching the files in the recipe root as they should be copied to the root project. The relative paths of these resources are equivalent.
- `extra.public-files` must be declared for any files which should be copied to the `public` web folder. If the project in question doesn't have any public folder, these will be copied to root instead. Note that all public files must be committed to the recipe `public` folder.

An example recipe:

```
{
    "name": "silverstripe/example-recipe",
    "description": "Example silverstripe recipe",
    "type": "silverstripe-recipe",
    "require": {
        "silverstripe/recipe-plugin": "^1.0",
        "silverstripe/recipe-cms": "^5.0",
        "silverstripe/blog": "^4.0",
        "silverstripe/lumberjack": "^3.0",
    },
    "extra": {
        "project-files": [
            "mysite/_config/*.yml",
            "mysite/code/MyBlogPage.php"
            "client/src/*"
        ],
        "public-files": [
            "client/dist/*"
        ]
    },
    "prefer-stable": true,
    "minimum-stability": "dev"
}
```

The files within this recipe would be organised in the structure:

```
client/
  src/
    blog.scss
mysite/
 _config/
    settings.yml
  code/
    MyBlogPage.php
public/
  client/
    dist/
      blog.css
composer.json

```

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community40

Growing community involvement

Maturity81

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~11 days

Total

21

Last Release

407d ago

Major Versions

0.2.0 → 1.0.02017-08-29

1.7.x-dev → 2.0.0-alpha12022-08-08

1.x-dev → 2.0.12024-06-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/654636?v=4)[Aaron Carlino](/maintainers/unclecheese)[@unclecheese](https://github.com/unclecheese)

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

![](https://avatars.githubusercontent.com/u/111025?v=4)[Ingo Schommer](/maintainers/chillu)[@chillu](https://github.com/chillu)

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

![](https://www.gravatar.com/avatar/afbb3dcc9ef29c1a6eedd6addcae5fce9ab1271915a85a4c349301b71237368d?d=identicon)[silverstripe-machine01](/maintainers/silverstripe-machine01)

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

![](https://avatars.githubusercontent.com/u/203294386?v=4)[-&gt; lozcalver](/maintainers/kinglozzer)[@kinglozzer](https://github.com/kinglozzer)

![](https://avatars.githubusercontent.com/u/1168676?v=4)[Maxime Rainville](/maintainers/maxime-rainville)[@maxime-rainville](https://github.com/maxime-rainville)

---

Top Contributors

[![emteknetnz](https://avatars.githubusercontent.com/u/4809037?v=4)](https://github.com/emteknetnz "emteknetnz (20 commits)")[![GuySartorelli](https://avatars.githubusercontent.com/u/36352093?v=4)](https://github.com/GuySartorelli "GuySartorelli (19 commits)")[![sabina-talipova](https://avatars.githubusercontent.com/u/87288324?v=4)](https://github.com/sabina-talipova "sabina-talipova (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (1 commits)")[![flamerohr](https://avatars.githubusercontent.com/u/1064889?v=4)](https://github.com/flamerohr "flamerohr (1 commits)")[![robbieaverill](https://avatars.githubusercontent.com/u/5170590?v=4)](https://github.com/robbieaverill "robbieaverill (1 commits)")[![andrewandante](https://avatars.githubusercontent.com/u/9702648?v=4)](https://github.com/andrewandante "andrewandante (1 commits)")

---

Tags

hacktoberfest

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/silverstripe-recipe-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/silverstripe-recipe-plugin/health.svg)](https://phpackages.com/packages/silverstripe-recipe-plugin)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

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