Coherence v0.4.0 mix coherence.install

Configure the Coherence User Model for your Phoenix application. Coherence is composed of a number of modules that can be enabled with this installer.

This installer will normally do the following unless given an option not to do so:

  • Append the :coherence configuration to your config/config.exs file.
  • Generate appropriate migration files.
  • Generate appropriate view files.
  • Generate appropriate template files.
  • Generate a web/coherence_web.ex file.
  • Generate a web/coherence_messages.ex file.
  • Generate a web/models/user.ex file if one does not already exist.

Install Examples

# Install with only the `authenticatable` option
mix coherence.install

# Install all the options except `confirmable` and `invitable`
mix coherence.install --full

# Install all the options except `invitable`
mix coherence.install --full-confirmable

# Install all the options except `confirmable`
mix coherence.install --full-invitable

# Install the `full` options except `lockable` and `trackable`
mix coherence.install --full --no-lockable --no-trackable

Reinstall Examples

# Reinstall with defaults (--silent --no-migrations --no-config --confirm-once)
mix coherence.install --reinstall

# Confirm to overwrite files, show instructions, and generate migrations
mix coherence.install --reinstall --no-confirm-once --with-migrations

Option list

A Coherence configuration will be appended to your config/config.exs file unless the --no-config option is given.

A --model="SomeModule tablename" option can be given to override the default User module.

A --repo=CustomRepo option can be given to override the default Repo module

A --router=CustomRouter option can be given to override the default Router module

A --default option will include only authenticatable

A --full option will include options authenticatable, recoverable, lockable, trackable, unlockable_with_token, registerable

A --full-confirmable option will include the --full options in addition to the --confirmable option

A --full-invitable option will include the --full options in addition to the --invitable option

An --authenticatable option provides authentication support to your User model.

A --recoverable option provides the ability to request a password reset email.

A --lockable option provides login locking after too many failed login attempts.

An --unlockable-with-token option provides the ability to request an unlock email.

A --trackable option provides login count, current login timestamp, current login ip, last login timestamp, last login ip in your User model.

A --trackable-table option provides trackable fields in the trackables table.

A --confirmable option provides support for confirmation email before the account can be logged in.

An --invitable option provides support for invitation emails, allowing the new user to create their account including password creation.

A --registerable option provide support for new users to register for an accountA—rememberableoption provide a remember me? check box for persistent logins

A --migration-path option to set the migration path

A --controllers option to generate controllers boilerplate (not default)

A --module option to override the module

A --installed-options option to list the previous install options

A --reinstall option to reinstall the coherence boilerplate based on your existing configuration options

A --silent option to disable printing instructions

A --confirm-once option to only confirm overwriting existing files once

A --with-migrations option to reinstall migrations. only valid for —reinstall option

Disable Options

  • --no-config — Don’t append to your config/config.exs file.
  • --no-web — Don’t create the coherence_web.ex file.
  • --no-messages — Don’t create the coherence_messages.ex file.
  • --no-views — Don’t create the web/views/coherence/ files.
  • --no-migrations — Don’t create the migration files.
  • --no-templates — Don’t create the web/templates/coherence files.
  • --no-boilerplate — Don’t create any of the boilerplate files.
  • --no-models — Don’t generate the model file.
  • --no-confirm — Don’t confirm overwriting files.

Link to this section Summary

Functions

Copies files from source dir to target dir according to the given map. Files are evaluated against EEx according to the given binding

A task needs to implement run which receives a list of command line args

Link to this section Functions

Link to this function controller_files()
Link to this function copy_from(apps, source_dir, target_dir, binding, mapping, config)

Copies files from source dir to target dir according to the given map. Files are evaluated against EEx according to the given binding.

Link to this function gen_coherence_templates(config)
Link to this function gen_coherence_views(config)
Link to this function get_config_options(opts)
Link to this function get_config_options(config_opts, opts)
Link to this function list_config_options(acc, opts)

A task needs to implement run which receives a list of command line args.

Callback implementation for Mix.Task.run/1.

Link to this function template_files()