Age | Commit message (Collapse) | Author |
|
It is equivalent to calling application:set_env/4 on
each application individually, except it is more efficient.
When given duplicate apps or duplicate keys, set_env/1
and set_env/2 will warn. The warning will also be emitted
during boot:
$ erl -config dupkeys.config -s erlang halt
2019-02-27 11:16:02.653100 application: kernel; duplicate parameter: key1
=WARNING REPORT==== 27-Feb-2019::11:16:02.653100 ===
application: kernel; duplicate parameter: key1
$ erl -config dupapps.config -s erlang halt
2019-02-27 11:16:02.653100 duplicate application config: kernel
=WARNING REPORT==== 27-Feb-2019::11:16:02.653100 ===
duplicate application config: kernel
Prior to this patch, the behaviour was unspecified,
and duplicate keys and duplicate apps would behave
different depending on the amount of config, the name
of the config files, and how those configs would be
listed. The goal is to raise an error in the future.
|
|
|
|
|
|
Also use this type in the start/2 callback spec.
|
|
* josevalim/jv-persistent-set-env:
Allow persistent option on set_env/4 and unset_env/3
OTP-11708
|
|
|
|
An environment key set with the persistent option will not
be overridden by the ones configured in the application resource
file on load. This means persistent values will stick after the
application is loaded and also on application reload.
|
|
This adds two new functions to the application module that will
recursively look for missing dependencies to start the entire dependency
chain of a given application, and then the application itself, if
possible.
Its entire behavior is based on the currently existing 'start/1-2'
functions, which will report dependencies that have not yet been started
and other problems encountered. 'ensure_all_started/1-2' will use this
information the way any programmer would manually do it to automate the
process.
This kind of functionality, while not OTP-ish (releases do this start
sequence for the user), is still useful for testing purposes, quick
demonstrations, and programmers who do not wish or know how to use OTP
releases.
The function returns '{ok, StartedApps}' for all started or already
started applications (already started are omitted from the list), and
will return '{error, {AppName, Reason}}' on a failure to allow users to
rapidly know why the function failed.
Note that no specific check is made for direct or indirect circular
dependencies between applications, and these will make the function go
in an infinite loop.
|
|
Similar to application:start/1,2 except it returns 'ok' on already
started applications instead of {'error', {'already_started', ...}}.
|
|
|
|
The new function provides a default value for a configuration
parameter.
|
|
It was possible to insert {Mod::atom(),Vsn::term()} instead of
Mod::atom() in the modules list in a .app file. This was not visible
in the documentation of .app files, but it was visible in the
documentation of application:load/[1,2] (where the .app file term can
be used directly as first argument).
The Vsn part was never used, so this possibility has now been removed.
|
|
|
|
|
|
|
|
|
|
|