PhoenixKit (phoenix_kit v1.7.125)

Copy Markdown View Source

PhoenixKit

Summary

Functions

Final boot step — call from Application.start/2 right after Supervisor.start_link/2.

Returns PhoenixKit configuration.

Validates if PhoenixKit is properly configured.

Returns the current version of PhoenixKit.

Functions

boot(result)

@spec boot({:ok, pid()} | {:error, term()}) :: {:ok, pid()} | {:error, term()}

Final boot step — call from Application.start/2 right after Supervisor.start_link/2.

Picks up :phoenix_kit_<x> modules whose beams loaded after PhoenixKit.ModuleRegistry initialised (a :phoenix_kit_* dep starts after :phoenix_kit itself, so the registry's first scan can miss it), then runs every registered module's migrate_legacy/0 callback.

Returns the supervisor result unchanged so it composes:

def start(_type, _args) do
  children = [...]
  opts = [strategy: :one_for_one, name: MyApp.Supervisor]
  Supervisor.start_link(children, opts) |> PhoenixKit.boot()
end

If Supervisor.start_link/2 returned {:error, _}, this is a no-op — the error passes through unchanged.

mix phoenix_kit.install and mix phoenix_kit.update wire this in automatically; existing apps can add the call manually.

config()

@spec config() :: map()

Returns PhoenixKit configuration.

Examples

iex> PhoenixKit.config()
%{ecto_repos: []}

configured?()

@spec configured?() :: boolean()

Validates if PhoenixKit is properly configured.

Checks for required configuration keys and returns a status.

Examples

iex> PhoenixKit.configured?()
false

version()

@spec version() :: String.t()

Returns the current version of PhoenixKit.

Examples

iex> PhoenixKit.version()
"1.3.3"