PHPackages                             rikudou/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. rikudou/installer

AbandonedArchivedComposer-plugin

rikudou/installer
=================

Composer plugin for automatic configuration of packages

v2.2.0(6y ago)08.4k11WTFPLPHPPHP ^7.1

Since Oct 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/RikudouSage/RikudouInstaller)[ Packagist](https://packagist.org/packages/rikudou/installer)[ RSS](/packages/rikudou-installer/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (8)Versions (25)Used By (1)

Rikudou Installer
=================

[](#rikudou-installer)

This composer plugin allows you to ship your configuration with your package for supported project types.

As soon as this package is installed in your project, it takes care of configuring your packages.

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

[](#installation)

`composer require rikudou/installer`

Using
-----

[](#using)

If you want to use the installer in your package, just add it as a dependency and create the configuration directory `.installer`.

The `.installer` directory has the following structure:

`.installer/[project-type-directory]/[operation-type]`

Project types
-------------

[](#project-types)

Currently only Symfony 4 project type is supported, but you can define your own types in your package (more on that below).

#### Symfony 4 project type

[](#symfony-4-project-type)

- available directories:
    - `symfony4`
    - `symfony`
- example directories:
    - `.installer/symfony4/[operation-type]`
    - `.installer/symfony/[operation-type]`
- detected via:
    - presence of the directory `config/packages`
- machine name:
    - `symfony4`

### Overriding project type composer.json

[](#overriding-project-type-composerjson)

If you want to set a project type for your project while it cannot be detected, you can set the `extra.rikudou.installer.project-type` in your composer.json, the value should be the machine name of desired project type.

If handler for the type does not exist, it will be ignored and the detection will still take place.

Example:

```
{
  "require": {
    "php": ">=7.2"
    // your other dependencies
  },
  "extra": {
    "rikudou": {
      "installer": {
        "project-type": "symfony4"
      }
    }
  }
}
```

> Note: JSON does not support comments, if you copy the above snippet, remove them

Operation types
---------------

[](#operation-types)

### Copy files operation

[](#copy-files-operation)

Everything from the operation dir (`files`) will be copied to the root directory of project.

On package uninstall any file that is identical in content to the one defined in package will be removed and any empty directory defined in directory structure will be removed.

- directory structure:
    - `.installer/[project-type-dir]/files`
- example directories:
    - `.installer/symfony4/files`
    - `.installer/symfony/files`
- example full directory structure
    - `.installer/symfony/files/config/packages/my_config_file.yaml`

### Env variables operation

[](#env-variables-operation)

Define your env variables in `.env` file and the content will be copied to `.env`, `.env.dist` and `.env.example` files in project root (if these files exist).

On package uninstall the environment variables will be deleted from the affected files.

- directory structure:
    - `.installer/[project-type-dir]/.env`
- example file path:
    - `.installer/symfony4/.env`
    - `.installer/symfony/.env`

### Bundle register operation

[](#bundle-register-operation)

Write a bundle config that will be appended to bundles.php file in Symfony.

On package uninstall the bundle configuration will be removed.

- directory structure
    - `.installer/[project-type-dir]/bundles.php`
- example file path:
    - `.installer/symfony4/bundles.php`

Example content:

```
