/doc/core/z_sites_manager.html
https://code.google.com/p/zotonic/ · HTML · 143 lines · 120 code · 23 blank · 0 comment · 0 complexity · 6724a52f5fde48fed80f6ebd457ade92 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Module z_sites_manager</title>
- <link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
- </head>
- <body bgcolor="white">
- <div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
- <hr>
- <h1>Module z_sites_manager</h1>
- <ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>Server managing all sites running inside Zotonic.
- <p>Copyright 2009-2010 Marc Worrell</p>
- <p><b>Behaviours:</b> <a href="gen_server.html"><tt>gen_server</tt></a>.</p>
- <p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
- <h2><a name="description">Description</a></h2>Server managing all sites running inside Zotonic. Starts the sites
- according to the config files in the sites subdirectories.
- <h2><a name="index">Function Index</a></h2>
- <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td>Convert process state when code is changed.</td></tr>
- <tr><td valign="top"><a href="#get_fallback_site-0">get_fallback_site/0</a></td><td>Return the name of the site to handle unknown Host requests.</td></tr>
- <tr><td valign="top"><a href="#get_site_config-1">get_site_config/1</a></td><td>Fetch the configuration of a specific site.</td></tr>
- <tr><td valign="top"><a href="#get_site_contexts-0">get_site_contexts/0</a></td><td>Return a list of contexts initialized for all active sites.</td></tr>
- <tr><td valign="top"><a href="#get_sites-0">get_sites/0</a></td><td>Return a list of active site names.</td></tr>
- <tr><td valign="top"><a href="#get_sites_all-0">get_sites_all/0</a></td><td>Return a list of all site names.</td></tr>
- <tr><td valign="top"><a href="#get_sites_status-0">get_sites_status/0</a></td><td>Return a list of all sites and their status.</td></tr>
- <tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td>Return the active sites.</td></tr>
- <tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td>Sync known sites with loaded sites.</td></tr>
- <tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td>Handling all non call/cast messages.</td></tr>
- <tr><td valign="top"><a href="#init-1">init/1</a></td><td>Initiates the server.</td></tr>
- <tr><td valign="top"><a href="#restart-1">restart/1</a></td><td>Restart a site.</td></tr>
- <tr><td valign="top"><a href="#start-1">start/1</a></td><td>Start a site.</td></tr>
- <tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>Starts the server.</td></tr>
- <tr><td valign="top"><a href="#stop-1">stop/1</a></td><td>Stop a site.</td></tr>
- <tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td>This function is called by a gen_server when it is about to
- terminate.</td></tr>
- <tr><td valign="top"><a href="#update_dispatchinfo-0">update_dispatchinfo/0</a></td><td>Update the webmachine dispatch information.</td></tr>
- <tr><td valign="top"><a href="#upgrade-0">upgrade/0</a></td><td>Sync the supervised sites with the sites in the sites directory.</td></tr>
- </table>
- <h2><a name="functions">Function Details</a></h2>
- <h3 class="function"><a name="code_change-3">code_change/3</a></h3>
- <div class="spec">
- <p><tt>code_change(OldVsn, State, Extra) -> {ok, NewState}</tt></p>
- </div><p>Convert process state when code is changed</p>
- <h3 class="function"><a name="get_fallback_site-0">get_fallback_site/0</a></h3>
- <div class="spec">
- <p><tt>get_fallback_site() -> atom() | undefined</tt></p>
- </div><p>Return the name of the site to handle unknown Host requests</p>
- <h3 class="function"><a name="get_site_config-1">get_site_config/1</a></h3>
- <div class="spec">
- <p><tt>get_site_config(Site::atom()) -> SiteProps::list() | {error, Reason}</tt></p>
- </div><p>Fetch the configuration of a specific site.</p>
- <h3 class="function"><a name="get_site_contexts-0">get_site_contexts/0</a></h3>
- <div class="spec">
- <p><tt>get_site_contexts() -> [Context]</tt></p>
- </div><p>Return a list of contexts initialized for all active sites.</p>
- <h3 class="function"><a name="get_sites-0">get_sites/0</a></h3>
- <div class="spec">
- <p><tt>get_sites() -> [atom()]</tt></p>
- </div><p>Return a list of active site names.</p>
- <h3 class="function"><a name="get_sites_all-0">get_sites_all/0</a></h3>
- <div class="spec">
- <p><tt>get_sites_all() -> [atom()]</tt></p>
- </div><p>Return a list of all site names.</p>
- <h3 class="function"><a name="get_sites_status-0">get_sites_status/0</a></h3>
- <div class="spec">
- <p><tt>get_sites_status() -> PropList</tt></p>
- </div><p>Return a list of all sites and their status.</p>
- <h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
- <div class="spec">
- <p><tt>handle_call(Message::Request, From, State) -> {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}</tt></p>
- </div><p>Return the active sites</p>
- <h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
- <div class="spec">
- <p><tt>handle_cast(Message::Msg, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
- </div><p>Sync known sites with loaded sites</p>
- <h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
- <div class="spec">
- <p><tt>handle_info(Info, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
- </div><p>Handling all non call/cast messages</p>
- <h3 class="function"><a name="init-1">init/1</a></h3>
- <div class="spec">
- <p><tt>init(X1::Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}</tt></p>
- </div><p>Initiates the server.</p>
- <h3 class="function"><a name="restart-1">restart/1</a></h3>
- <div class="spec">
- <p><tt>restart(Site) -> any()</tt></p>
- </div><p>Restart a site.</p>
- <h3 class="function"><a name="start-1">start/1</a></h3>
- <div class="spec">
- <p><tt>start(Site) -> any()</tt></p>
- </div><p>Start a site.</p>
- <h3 class="function"><a name="start_link-0">start_link/0</a></h3>
- <div class="spec">
- <p><tt>start_link() -> {ok, Pid} | ignore | {error, Error}</tt></p>
- </div><p>Starts the server</p>
- <h3 class="function"><a name="stop-1">stop/1</a></h3>
- <div class="spec">
- <p><tt>stop(Site) -> any()</tt></p>
- </div><p>Stop a site.</p>
- <h3 class="function"><a name="terminate-2">terminate/2</a></h3>
- <div class="spec">
- <p><tt>terminate(Reason, State) -> <a href="#type-void">void()</a></tt></p>
- </div><p>This function is called by a gen_server when it is about to
- terminate. It should be the opposite of Module:init/1 and do any necessary
- cleaning up. When it returns, the gen_server terminates with Reason.
- The return value is ignored.</p>
- <h3 class="function"><a name="update_dispatchinfo-0">update_dispatchinfo/0</a></h3>
- <div class="spec">
- <p><tt>update_dispatchinfo() -> any()</tt></p>
- </div><p>Update the webmachine dispatch information. Collects dispatch information from all sites and sends it
- to webmachine for updating its dispatch lists and host information.</p>
- <h3 class="function"><a name="upgrade-0">upgrade/0</a></h3>
- <div class="spec">
- <p><tt>upgrade() -> any()</tt></p>
- </div><p>Sync the supervised sites with the sites in the sites directory.
- Removes and stops deleted sites, adds (but does not start) new sites.</p>
- <hr>
- <div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
- <p><i>Generated by EDoc, Aug 12 2011, 20:01:39.</i></p>
- </body>
- </html>