Bio::Das::ProServer::Config - configuration parsing and hooks
$Revision: 687 $
Builds the ProServer configuration.
Configuration takes the following structure
[general] interface = * # interface to bind to ('*' for all) port = 9000 # port to listen on ; response_* attributes for servers behind a reverse proxy: response_hostname = # overriding hostname for responses response_port = # overriding port for responses response_protocol = # overriding protocol (http/s) for responses response_baseuri = # overriding base-uri for responses maxclients = 10 pidfile = logfile = ensemblhome = # path to ensembl libs (for sharing across sources) oraclehome = # path to oracle libs (for sharing across sources) bioperlhome = # path to bioperl libs (for sharing across sources) serverroot = # path to root directory (for stylesheets/coordinates) coordshome = # path to coordinate systems XML files styleshome = # path to stylesheet XML files http_proxy = # proxy for sources requiring web access maintainer = # email address strict_boundaries = # whether to filter out-of-range segments logformat = %i %t %r %s # then many of these with directives specific to each source [sourcename] adaptor = adaptorpackage title = Source Name description = A description of The Source. stylesheetfile = /path/to/stylesheet.xml ... # e.g. for mysql: transport = dbi dbhost = localhost dbport = 3306 dbuser = proserverro dbpass = password
my $oConfig = Bio::Das::ProServer::Config->new("/path/to/proserver.ini");
my $sPort = $oConfig->port();
my $sMaxClients = $oConfig->maxclients();
my $sPidFile = $oConfig->pidfile();
my $sLogFile = $oConfig->logfile();
my $sLogformat = $oConfig->logformat(); Special variables: %i Remote IP %h Remote hostname %t Local time (YYYY-MM-DDTHH:MM:SS) %r Request URI %s HTTP status code
my $sHost = $cfg->host(); Examines 'interface' and 'hostname' settings in that order
Useful for setting the hostname in XML/HTML responses when behind a reverse-proxy. my $sResponse_Hostname = $cfg->response_hostname(); Examines 'response_hostname', 'interface' and 'hostname' settings in that order
Useful for setting the port in XML/HTML responses when behind a reverse-proxy. my $sResponse_Port = $cfg->response_port(); Examines 'response_port' and 'port' settings in that order
Useful for setting the protocol in XML/HTML responses when behind a reverse-proxy. my $sResponse_Protocol = $cfg->response_protocol();
Useful for setting the baseuri (i.e. preceeding /das) in XML/HTML responses when behind a reverse-proxy. my $sResponse_Baseuri = $cfg->response_baseuri();
Useful for setting the full server URL in XML/HTML responses when behind a reverse-proxy. my $sServer_url = $cfg->server_url();
my $sInterface = $cfg->interface();
my @aAdaptors = $oConfig->adaptors(); Note this can be an expensive call if lots of sources or large hydra sets are configured.
my $oSourceAdaptor = $oConfig->adaptor($sWantedDSN);
my $bDSNIsKnown = $oConfig->knows($sWantedDSN);
my $sVersion = $oConfig->das_version(); By default 'DAS/1.53E';
my $sVersion = $oConfig->server_version(); By default 'ProServer/2.7';
my $oAdaptor = $oConfig->hydra_adaptor($sWantedDSN, $sHydraName); # fast my $oAdaptor = $oConfig->hydra_adaptor($sWantedDSN); # slow, performs a full scan of any configured hydras
my $oHydra = $oConfig->hydra($sHydraName);
$oConfig->log('a message');
Roger Pettett <rmp@sanger.ac.uk>.
Copyright (c) 2006 The Sanger Institute
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.
To install Bio::Das::ProServer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::Das::ProServer
CPAN shell
perl -MCPAN -e shell install Bio::Das::ProServer
For more information on module installation, please visit the detailed CPAN module installation guide.