-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
155 lines (145 loc) · 4.67 KB
/
config.php
File metadata and controls
155 lines (145 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
/**
* Complex config
* ==============
*
* Do not edit this file directly. Instead, modify any parameters using
* the file `local_config.php` instead. If this file does not exist, then
* make it a copy of this file and remove everything below the comment that
* says "COPY UNTIL HERE". Since this file will contain passwords, make
* sure to set as restrictive permissions as possible.
*/
$config = array();
/**
* ========
* Database
* ========
*
* MySQL database settings.
*
* Variables
* ---------
* host - IP or URL to the database server.
* user - Username.
* password - Password associated with the username.
* database - Database name.
* port - Port on the server to access.
* networks - Array of names of networks that should
* be displayed in Complex.
*/
$config["db"]["host"] = null;
$config["db"]["user"] = null;
$config["db"]["password"] = null;
$config["db"]["database"] = null;
$config["db"]["port"] = 3306;
$config["db"]["networks"] = array();
/**
* ==========
* Extensions
* ==========
*
* Controls network visualisation extensions.
*
* Variables
* ---------
* enabled - Boolean controlling whether extensions are
* enabled or not.
* dir - Directory where extension files are stored.
* active_extensions - Array of names of extensions that should be
* enabled. If the base name of an extension
* JSON file matches with any of the strings in
* this array, the extension will be active.
*/
$config["extensions"]["enabled"] = false;
$config["extensions"]["dir"] = dirname(__FILE__).'/extensions';
$config["extensions"]["active_extensions"] = array();
/**
* ===========
* Annotations
* ===========
*
* gofer2 settings
* ---------------
* gofer2 is used for fetching gene annotations.
* See https://github.com/bschiffthaler/gofer2.
*
* Variables
* ---------
* enabled - Boolean to decide whether gofer2 should be used or not.
* url - The url to the gofer2 API, including port.
* species - Associative array between species and the corresponding
* species code used by gofer2.
*
* Example:
* array(
* "Arabidopsis thaliana" => "athaliana",
* "Populus tremula" => "potra"
* )
*/
$config["gofer2"]["enabled"] = false;
$config["gofer2"]["url"] = null;
$config["gofer2"]["species"] = array();
/**
* GenIE API settings
* ------------------
* Settings controlling what GenIE instances should be used for
* managing gene lists, amongst other things.
*
* Variables
* ---------
* enabled - Boolean to decide whether the GenIE integration should
* be enabled.
* url - URL to the GenIE API.
* instances - An array of arrays of GenIE instances that are available.
* Each instance should have the keys species (full species
* name), name (MySQL table name), code (short species name),
* and defaultLists. defaultLists is an array of arrays of
* gene lists that always should be available in Complex.
* Each entry should have the keys gene_basket_name (name of
* the gene list) and gene_list (a comma-separated list of
* genes).
*
* Example of a single instance:
* array(
* array(
* "species" => "Arabidopsis thaliana", // species name
* "name" => "atgenie", // database name
* "code" => "artha", // short species identifier
* "defaultLists" => array( // default lists to show in Complex
* array(
* "gene_basket_name" => "Example",
* "gene_list" => "AT1G06590, AT1G15570, AT1G34065"
* )
* )
* )
* )
*/
$config["gene"]["enabled"] = false;
$config["genie"]["url"] = null;
$config["genie"]["instances"] = array();
/********************************************
* *
* COPY UNTIL HERE *
* *
* and don't forget to close the php tag... *
* *
********************************************/
/**
* Include local config file that can be used to override settings in
* this file.
*/
require_once("local_config.php");
/**
* Save relevant parts of the config to a JSON file, if requested.
*/
if (isset($_GET["init"])) {
file_put_contents(
"config.json",
json_encode(array(
"gofer2" => $config["gofer2"],
"genie" => $config["genie"],
"extensions" => $config["extensions"])
)
);
}
?>