Environment
Currently, there are two environment configuration items available for Swarm:
-
mode: whether Swarm operates in production or development mode.
-
hostname: specifies the canonical hostname Swarm should use, such as in links to Swarm in email notifications.
Add the following configuration block to the
data/config.php
file:
<?php
// this block should be a peer of 'p4'
'environment' => array(
'mode' => 'development', // defaults to 'production'
'hostname' => 'myswarmhostname', // defaults to requested hostname
),
Mode
By default, Swarm operates in production mode. When
mode
is set to development
,
Swarm displays greater error detail in the browser. Also, Swarm switches
from including aggregated and minified JavaScript and CSS to requesting
each JavaScript and CSS resource for all active modules. The default value
is production
. Any value other than
development
is assumed to mean
production
.
development
mode makes it easier to discover problems
and to identify their source, but also incurs additional browser overhead
due to many more JavaScript and CSS requests for larger files. We
recommend that you do not use development
mode in
production environments, unless directed to do so by Perforce technical
support.
Hostname
The hostname
item allows you to specify Swarm's
hostname. This could be useful if you have multiple virtual hosts deployed
for a single Swarm instance; Swarm uses the hostname you configure when
generating its web pages and email notifications.
Note
The value specified for the hostname
item should
be just the hostname. It should not include a scheme (e.g.
"http://
"), nor should it include a port (e.g.
":80
").