# `MishkaBlog.Plugins.Installer`
[🔗](https://github.com/mishka-group/mishka_blog/blob/v0.0.1/lib/mishka_blog/plugins/installer.ex#L5)

Installs the blog onto one site, when asked.

Subscribing to `installer:extension:install` is the whole declaration: the installer's own
registry now knows this extension exists, under `:mishka_blog`, at priority 50, and `:extra` below
is what the picker draws. Nothing is registered anywhere else, and there is no list of extensions
to keep in step with this file.

A SITE IS NEVER SET UP BEHIND SOMEBODY'S BACK. This answers a request naming a site; it does not
listen for a site being created. A site added to a running CMS gets its own core content and
nothing else until an admin asks for the blog from the Blog menu — which is the only honest
default, because a site may be a landing page that will never have a blog.

The request's `:actor` is whoever pressed the button and must hold what
`MishkaCmsCore.Runtime.ExtensionProvision.required/1` names. A request with no actor is the
install wizard's own run and is answered only until the CMS is installed
(`MishkaCmsCore.Install.installed?/0`); after that it is refused like an actor holding nothing.

# `error_return`

```elixir
@type error_return() ::
  {:error, [%{action: atom(), field: atom(), message: String.t()}]}
```

# `okey_return`

```elixir
@type okey_return() :: {:ok, struct() | map() | module() | [any()]}
```

# `call`

Installs the blog when the payload names it, and hands the payload on untouched when it does not.

The report goes back in `:reports` rather than as the reply itself, because every plugin on this
event sees every call: replying with the report would make the next plugin's payload a report.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `config`

```elixir
@spec config() :: keyword()
```

# `config`

```elixir
@spec config(atom()) :: any()
```

# `enable`

```elixir
@spec enable() :: okey_return() | error_return()
```

# `get`

```elixir
@spec get() :: keyword()
```

# `health_check`

```elixir
@spec health_check() :: :ok | {:degraded, term()} | {:error, term()}
```

Optional. See `c:MishkaInstaller.Event.Hook.health_check/0`. Override to report health.

# `on_dependency_error`

```elixir
@spec on_dependency_error(term()) :: term()
```

Optional. See `c:MishkaInstaller.Event.Hook.on_dependency_error/1`. Override to react.

# `register`

```elixir
@spec register() :: okey_return() | error_return()
```

# `restart`

```elixir
@spec restart() :: okey_return() | error_return()
```

# `start`

```elixir
@spec start() :: okey_return() | error_return()
```

# `start_link`

# `stop`

```elixir
@spec stop() :: okey_return() | error_return()
```

# `unregister`

```elixir
@spec unregister() :: okey_return() | error_return()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
