defmodule Mix.Tasks.Phoenix.Server do
  use Mix.Task

  @shortdoc "Starts applications and their servers"

  @moduledoc """
  Starts the application by configuring all endpoints servers to run.
  """
  def run(args) do
    Application.put_env(:phoenix, :serve_endpoints, true, persistent: true)
    Mix.Task.run "app.start", args
    no_halt
  end

  defp no_halt do
    unless iex_running?, do: :timer.sleep(:infinity)
  end

  defp iex_running? do
    Code.ensure_loaded?(IEx) && IEx.started?
  end
end

defmodule Mix.Tasks.Phoenix.Server do
  use Mix.Task

  @shortdoc "Starts applications and their servers"

  @moduledoc """
  Starts the application by configuring all endpoints servers to run.

  ## Command line options

  This task accepts the same command-line arguments as `app.start`. For additional
  information, refer to the documentation for `Mix.Tasks.App.Start`.

  For example, to run `phoenix.server` without checking dependencies:

    mix phoenix.server --no-deps-check

  """
  def run(args) do
    Application.put_env(:phoenix, :serve_endpoints, true, persistent: true)
    Mix.Task.run "app.start", args
    no_halt
  end

  defp no_halt do
    unless iex_running?, do: :timer.sleep(:infinity)
  end

  defp iex_running? do
    Code.ensure_loaded?(IEx) && IEx.started?
  end
end

Add documentation note about args which cross-reference app.start
Add documentation note about args which cross-reference app.start

optikfluffel/phoenix,vic/phoenix,jamilabreu/phoenix,eksperimental/phoenix,0x00evil/phoenix,safi/phoenix,bsmr-erlang/phoenix,bsmr-erlang/phoenix,lono-devices/phoenix,ericmj/phoenix,romul/phoenix,korobkov/phoenix,eksperimental/phoenix,keathley/phoenix,optikfluffel/phoenix,thegrubbsian/phoenix,dmarkow/phoenix,jwarwick/phoenix,kidaa/phoenix,mvidaurre/phoenix,cas27/phoenix,lono-devices/phoenix,evax/phoenix,mitchellhenke/phoenix,ephe-meral/phoenix,doron2402/phoenix,manukall/phoenix,tony612/phoenix,manukall/phoenix,CultivateHQ/phoenix,rodrigues/phoenix,vic/phoenix,evax/phoenix,ephe-meral/phoenix,rodrigues/phoenix,rafbgarcia/phoenix,cas27/phoenix,rafbgarcia/phoenix,trarbr/phoenix,brucify/phoenix,Fluxuous/phoenix,Ben-Evolently/phoenix,omotenko/phoenix_auth,0x00evil/phoenix,ugisozols/phoenix,StevenNunez/phoenix,sdnorm/phoenix,begleynk/phoenix,Kosmas/phoenix,phoenixframework/phoenix,nshafer/phoenix,Kosmas/phoenix,foxnewsnetwork/phoenix,Rumel/phoenix,wicliff/phoenix,wsmoak/phoenix,iStefo/phoenix,Eventacular/phoenix,nicrioux/phoenix,ericmj/phoenix,stefania11/phoenix,Smulligan85/phoenix,seejee/phoenix,jamilabreu/phoenix,iguberman/phoenix,wsmoak/phoenix,mobileoverlord/phoenix,Smulligan85/phoenix,arthurcolle/phoenix,phoenixframework/phoenix,paulcsmith/phoenix,dmarkow/phoenix,kevinold/phoenix,lancehalvorsen/phoenix,hotvulcan/phoenix,yonglehou/phoenix,Joe-noh/phoenix,javimolla/phoenix,bsodmike/phoenix,mobileoverlord/phoenix,rafbgarcia/phoenix,sadiqmmm/phoenix,seejee/phoenix,Gazler/phoenix,maxnordlund/phoenix,ahmetabdi/phoenix,pap/phoenix,JHKennedy4/phoenix,kholbekj/phoenix,jxs/phoenix,bdtomlin/phoenix,fbjork/phoenix,0x00evil/phoenix,michalmuskala/phoenix,henrik/phoenix,Gazler/phoenix,nshafer/phoenix,milafrerichs/phoenix,jasond-s/phoenix,jwarwick/phoenix,CD1212/phoenix,gjaldon/phoenix,FND/phoenix,KazuCocoa/phoenix,doomspork/phoenix,iStefo/phoenix,Joe-noh/phoenix,linearregression/phoenix,y-yagi/phoenix,jeffweiss/phoenix,DavidAlphaFox/phoenix,Dahoon/phoenix,gjaldon/phoenix,mschae/phoenix,justnoxx/phoenix,robomc/phoenix,nshafer/phoenix,andrewvy/phoenix,VictorZeng/phoenix,stevedomin/phoenix,trarbr/phoenix,mvidaurre/phoenix,ybur-yug/phoenix,esbullington/phoenix-1,keathley/phoenix,switchflip/phoenix,michalmuskala/phoenix,GabrielNicolasAvellaneda/phoenix,greyhwndz/phoenix,scrogson/phoenix,Rumel/phoenix,elliotcm/phoenix,andrewvy/phoenix,phoenixframework/phoenix,beni55/phoenix,stevedomin/phoenix,CultivateHQ/phoenix,jeffkreeftmeijer/phoenix,yoavlt/phoenix,optikfluffel/phoenix,DavidAlphaFox/phoenix,marcioj/phoenix,ybur-yug/phoenix,korobkov/phoenix,pap/phoenix,hsavit1/phoenix,robhurring/phoenix,daytonn/phoenix,mschae/phoenix,mitchellhenke/phoenix,lancehalvorsen/phoenix,omotenko/phoenix_auth,nickgartmann/phoenix,kyledecot/phoenix