1defmodule Phoenix do
2  @moduledoc """
3  This is the documentation for the Phoenix project.
4
5  By default, Phoenix applications depend on the following packages:
6
7    * [Ecto](https://hexdocs.pm/ecto) - a language integrated query and
8      database wrapper
9
10    * [Phoenix](https://hexdocs.pm/phoenix) - the Phoenix web framework
11      (these docs)
12
13    * [Phoenix.js](js) - Phoenix Channels JavaScript client
14
15    * [Phoenix Pubsub](https://hexdocs.pm/phoenix_pubsub) - a distributed
16      pubsub system with presence support
17
18    * [Phoenix HTML](https://hexdocs.pm/phoenix_html) - conveniences for
19      working with HTML in Phoenix
20
21    * [Plug](https://hexdocs.pm/plug) - a specification and conveniences
22      for composable modules in between web applications
23
24    * [Gettext](https://hexdocs.pm/gettext) - Internationalization and
25      localization through gettext
26
27  There are also optional packages depending on your configuration:
28
29    * [Phoenix PubSub Redis](https://hexdocs.pm/phoenix_pubsub_redis) - use
30      Redis to power Phoenix PubSub system
31
32  """
33  use Application
34
35  @doc false
36  def start(_type, _args) do
37    # Warm up caches
38    _ = Phoenix.Template.engines
39    _ = Phoenix.Template.format_encoder("index.html")
40
41    # Configure proper system flags from Phoenix only
42    if stacktrace_depth = Application.get_env(:phoenix, :stacktrace_depth) do
43      :erlang.system_flag(:backtrace_depth, stacktrace_depth)
44    end
45
46    # Start the supervision tree
47    import Supervisor.Spec
48
49    children = [
50      # Code reloading must be serial across all Phoenix apps
51      worker(Phoenix.CodeReloader.Server, [])
52    ]
53
54    Supervisor.start_link(children, strategy: :one_for_one, name: Phoenix.Supervisor)
55  end
56end
57