/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
1 by Suren A. Chilingaryan
Initial import
1
<?php
308 by Suren A. Chilingaryan
Prevent deprecation and strict-mode errors
2
    error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
243 by Suren A. Chilingaryan
Move timezone setup into the config.php
3
    date_default_timezone_set("UTC");
1 by Suren A. Chilingaryan
Initial import
4
5
    $SETUP_MULTI_MODE = true;
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
6
    
412 by Suren A. Chilingaryan
Support multi-server SETUP subsets
7
    $ADEI_RELEASE = true;
1 by Suren A. Chilingaryan
Initial import
8
9
    $TITLE = "ADEI";
10
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
11
        // INNODB is required for replication, MyISAM in other case especially on the systems with low IOPS
12
        // MyISAM tables are significantly smaller and less disk intensive
484 by Suren A. Chilingaryan
Group INSERTs into the transactions for better INNODB performance
13
        // Compression with Katrin dataset give 35% of data savings, but results 50-70% performance degradation
14
        // There is more CPU usage, but systems are not bound by CPU, so reason is not completely clear
15
    $ADEI_CACHE_ENGINE = "MYISAM";		// "INNODB"
16
    $ADEI_TRANSACTION_SIZE = 0;	                // 0 to disable
17
    $ADEI_CONTINUOUS_TRANSACTION = true;        // required unless we have a perfectly tuned configuration
18
    $ADEI_CACHE_COMPRESSION = "None";		// "zlib"
19
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
20
        // This does not help much to performance and may create problems under some circumstances. Don't turn on.
21
    $ADEI_DELAYED_KEYS = false;			
22
465 by Suren A. Chilingaryan
Initial release of scheduling service
23
    $ADEI_CACHE_SCHEDULER = false;
471 by Suren A. Chilingaryan
Scheduler improvements
24
    $ADEI_CONTINUOUS_CACHING = false;
402 by Suren A. Chilingaryan
Support srctree minimal mode
25
    $ADEI_DEFAULT_MODE = false;
96 by Suren A. Chilingaryan
WiKi integration
26
    $DEFAULT_MODULE = "wiki";
253 by Suren A. Chilingaryan
Initial support of secondary views
27
344 by Suren A. Chilingaryan
Disable control and alarms pages in the default configuration
28
    $MODULES = array(/*"slowcontrol", "alarms",*/ "infopage", "graph", "download", "wiki");
12 by Suren A. Chilingaryan
Layout redesign: search tab, controls, menu
29
    $POPUPS = array("source", "controls");
100 by Suren A. Chilingaryan
Initial SEARCH implementation
30
253 by Suren A. Chilingaryan
Initial support of secondary views
31
    $CONTROLS = array("infotab", "searchtab", "virtual", false, "export", "aggregator", "plot"); // false/null indicates line break
239 by Suren A. Chilingaryan
Basic implementation of TANGOReader
32
    
33
    $ADEI_SRCTREE_EXTRA = array();
253 by Suren A. Chilingaryan
Initial support of secondary views
34
    $ADEI_INFO_MODULES = array(
35
        "legend" => array(
36
            'title' => _("Channel Overview"),
37
            'handler' => "CHANNELView",
38
            'opts' => array()
39
        ),
40
        "scatter" => array(
41
            'title' => _("Scatter Plot"),
42
            'handler' => "SCATTERView",
43
            'opts' => array()
311 by Suren A. Chilingaryan
Histogram view (based on the code by Hovhannes)
44
        ),
372 by Suren A. Chilingaryan
Merge SPECTRUMView from Arthur
45
        "spectrum" => array(
46
            'title' => _("Spectrum"),
47
            'handler' => "spectrumview",
48
            'opts' => array()
49
        ),
311 by Suren A. Chilingaryan
Histogram view (based on the code by Hovhannes)
50
        "histogram" => array(
51
            'title' => _("Histogram"),
52
            'handler' => "histogramview",
53
            'opts' => array(
54
		'bins' => array(0, 5, 10, 20, 50)
55
            )
56
        ),
253 by Suren A. Chilingaryan
Initial support of secondary views
57
    );
58
1 by Suren A. Chilingaryan
Initial import
59
60
	/* more specific configs should go after less specific ones */
61
    $OPTIONS = array (
62
	"default" => array( 
63
	    "min_resolution" => 600, 		// in db config could be array by id
64
//	    "cache_config" => $ADEI_CACHE	// alter default cache timing configuration
65
	    "ignore_subseconds" => true,	// Timestamps with second precision
66
	    "omit_raw_cache" => false,		// Use data source instead of cache0 tables
67
	    "fill_raw_first" => false,		// Fill RAW cache table completely prior to processing agregating cache tables
68
	    "optimize_empty_cache" => false,	// Do not fill lower resolution cache intervals if encompassing one is empty
69
	    "use_cache_timewindow" => true,	// Shrink time window to currently cached data
70
	    "use_cache_reader" => false,	// Do not access data source while reading cache
71
	    "overcome_reader_faults" => false,	// Use CACHE if connection to reader is failed
72
	    "optimize_time_axes" => false,	// Limit window size by available data
73
	    "use_md5_postfix" => false,		// Use md5 for table name postfixes
71 by Suren A. Chilingaryan
Fast data support in TESTReader
74
	    "null_value" => 0,			// The numeric value to use instead of NULL (missing data) when needed
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
75
	    "disable_caching" => false,		// The CACHE should not be generated, Item for RT display only
76
	    "channel_uids" => false,		// If channels have unique identifactors within ADEI setup
263 by Suren A. Chilingaryan
Support private source axes
77
	    "private_axes" => false,            // The READER has his own set of axes which shall not be mixed with global ones
1 by Suren A. Chilingaryan
Initial import
78
	)
79
    );
80
    
81
82
    $ADEI_DB = array (
83
	"host" => "localhost",
84
	"port" => 0,
85
	"database" => "adei",
86
	"user" => "adei",
87
	"password" => "adei"
88
    );
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
89
    
1 by Suren A. Chilingaryan
Initial import
90
/*
91
    The TSQLFile support in ROOT is not mature enough    
92
    $ROOT_DB = array (
93
	"driver" => "mysql",
94
	"host" => "localhost",
95
	"port" => 0,
96
	"user" => "zeus",
97
	"password" => "zeus"
98
    );
99
*/
100
    
101
    $BACKUP_DB = array (
102
	"driver" => "mysql",
103
	"host" => "localhost",
104
	"port" => 0,
105
	"user" => "zeus",
106
	"password" => "zeus"
107
    );
108
109
    $ADEI_TIMINGS = array (
110
	_("1 Year") => 31536000,
111
	_("1 Month") => 2592000,
112
	_("1 Week") => 604800,
113
	_("1 Day") => 86400,
114
	_("6 Hours") => 21600,
115
	_("1 Hour") => 3600,
116
	_("15 Min") => 900,
117
	_("5 Min") => 300
118
    );
119
    
120
    
121
    $ADEI_CACHE = array (
122
	array("min" => 31536000, "res" => 43200), /* year - 12 hour data, 730 points min */
123
	array("min" => 2592000, "res" => 3600), /* month - 1 hour data, 720 - 8760 data points */
124
	array("min" => 604800, "res" => 600), /* week - 10 min data, 1008 - 4320 data points */
125
	array("min" => 86400, "res" => 60), /* day - 1 min data, 1440 - 10080 data points */
126
	array("min" => 7200, "res" => 10), /* 2 hours - 10 s, 720 - 8640 data points */
127
	/* 1 - 7200 data points */
128
    );
69 by Suren A. Chilingaryan
Fist step of importing infrastracture fro VIRTUAL data sources and COMPLEX LogGroups
129
    
130
    
131
    $ADEI_VIRTUAL_READERS = array(
83 by Suren A. Chilingaryan
Initial support for alarms in backend, DB retries on link failures, more on axis
132
/*	"virtual_vg" => array(
133
	    "title" => _("User Groups"),
134
	    "reader"=> "VGReader"
135
	),*/
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
136
	"virtual" => array(
137
	    "title" => _("Virtual"),
138
	    "reader" => "VIRTUALReader"
83 by Suren A. Chilingaryan
Initial support for alarms in backend, DB retries on link failures, more on axis
139
	)
69 by Suren A. Chilingaryan
Fist step of importing infrastracture fro VIRTUAL data sources and COMPLEX LogGroups
140
    );
1 by Suren A. Chilingaryan
Initial import
141
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
142
    $ADEI_AXES = array(
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
143
/*	"0" => array(
144
	),*/
193 by Suren A. Chilingaryan
Few fixes and setup for ASEC installation
145
	"countrate" => array(
146
	    "axis_name" => _("Count Rate"),
147
	    "axis_units" => false,
329 by Suren A. Chilingaryan
Fix axis_mode naming
148
	    "axis_mode" => "STD",
193 by Suren A. Chilingaryan
Few fixes and setup for ASEC installation
149
	    "axis_range" => false
150
	),    
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
151
	"percent" => array(
152
	    "axis_name" => false,
153
	    "axis_units" => _("%"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
154
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
155
	    "axis_range" => false
156
	),    
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
157
	"temperature" => array(
158
	    "axis_units" => _("C"),
159
	    "axis_name" => _("Temperature"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
160
	    "axis_mode" => "STD",
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
161
	    "axis_range" => false
162
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
163
	"temperature/kelvin" => array(
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
164
	    "axis_units" => _("K"),
165
	    "axis_name" => _("Temperature"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
166
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
167
	    "axis_range" => false
168
	),
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
169
	"voltage" => array(
170
	    "axis_units" => _("V"),
171
	    "axis_name" => _("Voltage"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
172
	    "axis_mode" => "STD",
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
173
	    "axis_range" => false
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
174
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
175
	"voltage/kilo" => array(
176
	    "axis_units" => _("kV"),
177
	    "axis_name" => _("Voltage"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
178
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
179
	    "axis_range" => false
180
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
181
	"current" => array(
182
	    "axis_units" => _("A"),
183
	    "axis_name" => _("Current"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
184
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
185
	    "axis_range" => false
186
	),
317 by Suren A. Chilingaryan
Revise global axes
187
	"current/micro" => array(
182 by Suren A. Chilingaryan
New TOSKA configuration
188
	    "axis_units" => _("uA"),
189
	    "axis_name" => _("Current"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
190
	    "axis_mode" => "STD",
182 by Suren A. Chilingaryan
New TOSKA configuration
191
	    "axis_range" => false
192
	),
317 by Suren A. Chilingaryan
Revise global axes
193
	"current/nano" => array(
194
	    "axis_units" => _("nA"),
195
	    "axis_name" => _("Current"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
196
	    "axis_mode" => "STD",
317 by Suren A. Chilingaryan
Revise global axes
197
	    "axis_range" => false
198
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
199
	"resistance" => array(
200
	    "axis_units" => _("Ohm"),
201
	    "axis_name" => _("Resistance"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
202
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
203
	    "axis_range" => false
204
	), 
205
	"pressure" => array(
206
	    "axis_units" => _("bar"),
207
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
208
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
209
	    "axis_range" => false
210
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
211
	"pressure/psi" => array(
212
	    "axis_units" => _("psi"),
213
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
214
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
215
	    "axis_range" => false
216
	),
317 by Suren A. Chilingaryan
Revise global axes
217
	"pressure/milli" => array(
218
	    "axis_units" => _("millibar"),
219
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
220
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
221
	    "axis_range" => false
222
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
223
	"pressure/hpa" => array(
224
	    "axis_units" => _("hPa"),
225
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
226
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
227
	    "axis_range" => false
228
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
229
	"mass" => array(
230
	    "axis_units" => _("kg"),
231
	    "axis_name" => _("Mass"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
232
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
233
	    "axis_range" => false
234
	),
317 by Suren A. Chilingaryan
Revise global axes
235
	"rpm" => array(
236
	    "axis_units" => _("rpm"),
335 by Suren A. Chilingaryan
Prevent overgrowing of source popup due to hoardes of axes
237
	    "axis_name" => _("RPM"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
238
	    "axis_mode" => "STD",
317 by Suren A. Chilingaryan
Revise global axes
239
	    "axis_range" => false
240
	),
241
	"volume-flow" => array(
242
	    "axis_units" => _("m3/s"),
243
	    "axis_name" => _("Flow"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
244
	    "axis_mode" => "STD",
317 by Suren A. Chilingaryan
Revise global axes
245
	    "axis_range" => false
246
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
247
	"mass-flow" => array(
248
	    "axis_units" => _("g/s"),
249
	    "axis_name" => _("Mass-flow"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
250
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
251
	    "axis_range" => false
252
	),
317 by Suren A. Chilingaryan
Revise global axes
253
	"power" => array(
254
	    "axis_units" => _("W"),
255
	    "axis_name" => _("Power"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
256
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
257
	    "axis_range" => false
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
258
	),
259
	"magnetic_field" => array(
260
	    "axis_units" => _("T"),
261
	    "axis_name" => _("Magnetic field"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
262
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
263
	    "axis_range" => false
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
264
	)
265
    );
266
23 by Suren A. Chilingaryan
Administrative interface and better handling of missing group channels
267
    $DEFAULT_MISSING_VALUE = NULL;	/* Value to use instead of NULL values */
1 by Suren A. Chilingaryan
Initial import
268
269
    $EXPORT_DEFAULT_FORMAT = "csv";
270
    
271
    /* Joiner/Filter: Joiner is a filter supporting multiple groups. From the
272
    software point of view there is no difference and both are implemented 
273
    using the same base class. It is possible to have arbitrary sequence of
274
    enclosed filters/joiners within format configuration.
275
    Only joiner or filter should be specified on the one level, if both
276
    are specified the filter will be used.
277
    
278
	@PROP@ 			- replaced by passed value
279
	?{@PROP@?@PROP@:nothing}
280
281
      Default:
282
	@TMPFILE@
283
	@BLOCK_TITLE@
284
	@EXPECTED_BLOCKS@
285
	@BLOCK_NUMBER@
286
287
288
	@ROOT__COMBHIST@	
289
    */
290
    
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
291
    $ADEI_SYSTEM_FORMATS = array (
292
	"labview32" => array(
293
	    'title' => "LabVIEW array",
294
	    'handler' => "LABVIEW",
295
	    'hidden' => true,
296
	    'type' => "streamarray"
297
	)
298
    );
299
    
1 by Suren A. Chilingaryan
Initial import
300
    $EXPORT_FORMATS = array (
301
	"csv" => array(
302
	    'title' => "CSV",
43 by Suren A. Chilingaryan
Data filtering support
303
	    'accept_null_values' => true
1 by Suren A. Chilingaryan
Initial import
304
	),
195 by Suren A. Chilingaryan
Image Export by Arsen Sogomonyan
305
     	"image" => array(
306
    	    'title' => "PNG Image",
307
            'handler' => 'Image',
308
 	    'type' => 'image'
309
     	),
1 by Suren A. Chilingaryan
Initial import
310
	"xls" => array(
311
	    'title' => "Excel",
312
	    'handler' => "EXCEL",
313
//	    subsec_format => "DD.MM.YYYY hh:mm:ss.000;@"
314
//	    subsec_format => "text()" /* Use text (CSV) */
315
//	    subsec_format => "text(format)" /* Use text (format) */
316
//	    subsec_format => "DD.MM.YYYY hh:mm:ss.000000;@" /* HP, OpenOffice */
317
//	    subsec_width => 26
318
//	    date_format => "DD.MM.YYYY hh:mm:ss"
319
//	    date_width => 20
320
//	    value_format => "0.0000E+##"
321
//	    value_width => 12
322
/*	    filter => array (
323
		"type" => "ZIP"
324
	    )*/
408 by Suren A. Chilingaryan
Include netcdf exported from ntj
325
        ),
326
/*
327
	"nc" => array(
328
	    'title' => "netCDF4",
329
	    'filter' => array (
330
		'app' => "csv2netcdf",
331
		'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@}",
332
		'joiner' => true,
333
		'groupmode' => true,	// Run filter app for each group
334
	        'extension' => "nc"
335
	    )
1 by Suren A. Chilingaryan
Initial import
336
	),
408 by Suren A. Chilingaryan
Include netcdf exported from ntj
337
	"root" => array(
1 by Suren A. Chilingaryan
Initial import
338
	    'title' => "ROOT",
339
	    'filter' => array (
340
		'app' => "csv2root",
341
		'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@}",
342
		'joiner' => true,
310 by Suren A. Chilingaryan
Disable ROOT export in default configuration
343
		'groupmode' => true,	// Run filter app for each group
1 by Suren A. Chilingaryan
Initial import
344
	        'extension' => "root"
345
	    )
346
	),
347
	"root_hist" => array(
348
	    'title' => "ROOT+Hist",
349
	    'filter' => array(
350
		'app' => "csv2root",
351
		'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@} --save-histograms ?{@ROOT__COMBHIST@?--combined-histogram}",
352
		'joiner' => true,
310 by Suren A. Chilingaryan
Disable ROOT export in default configuration
353
		'groupmode' => true,	// Run filter app for each block
1 by Suren A. Chilingaryan
Initial import
354
		'extension' => "root"
355
	    )
310 by Suren A. Chilingaryan
Disable ROOT export in default configuration
356
	),*/
43 by Suren A. Chilingaryan
Data filtering support
357
	"tdms" => array(
358
	    'title' => "TDMS",
359
	    'handler' => "LABVIEW",
1 by Suren A. Chilingaryan
Initial import
360
	)
361
    );
362
    
363
    $EXPORT_SAMPLING_RATES = array (
364
	_("Hourly") => 3600,
365
	_("Minutely") => 60,
366
	_("1 Hz") => 1,
367
	_("1000 Hz") => 0.001
368
    );
369
    
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
370
    $SEARCH_ENGINES = array (
100 by Suren A. Chilingaryan
Initial SEARCH implementation
371
	"ITEMSearch" => array(),
101 by Suren A. Chilingaryan
Further search improvements, support for custom properties (config)
372
	"INTERVALSearch" => array(),
373
	"PROXYSearch" => array()
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
374
    );
375
    
79 by Suren A. Chilingaryan
New version of dhtmlxmenu and dhtmlxtree is added
376
    
377
    $ADEI_ID_DELIMITER = "__";
378
    
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
379
    $LOGGER_LOG_REQUESTS = false;	/* Log all ADEI requests */
380
    $LOGGER_LOG_OUTPUT = false;		/* Log output of ADEI requests */
290 by Suren A. Chilingaryan
Limit size of log files unless config option is specified
381
    $LOGGER_STORE_OBJECTS = false;	/* Will produce big, but very detailed logs */
32 by Suren A. Chilingaryan
Option to force MySQL optimizer to use INDEXEs on queries involving huge rowsets. Use unbuffered mysql queries on RAWPoint cache requests
382
383
/* This forces MySQL to use INDEXes while SELECT queries returning huge 
384
rowsets are executed. After certain threshold, MySQL optimizator stops
385
using INDEXes what bringing to huge slowdown. This option is intended
386
to fix this behaviour. */
210.1.2 by Suren A. Chilingaryan
Download manager by Aki Rimpelainen
387
    
32 by Suren A. Chilingaryan
Option to force MySQL optimizer to use INDEXEs on queries involving huge rowsets. Use unbuffered mysql queries on RAWPoint cache requests
388
    $MYSQL_FORCE_INDEXES = true;	
24 by Suren A. Chilingaryan
Logger subsystem
389
    
1 by Suren A. Chilingaryan
Initial import
390
    $CACHE_PRECISE_GAPS = false;	/* Enables more precise maxgap calculation in DATAInterval */
391
    
392
    $AJAX_UPDATE_RATE = 60; 		/* in seconds */
393
    $AJAX_WINDOW_BORDER = 10; 		/* in pixels */
394
    $AJAX_PARSE_DELAY = 100; 		/* html, in milliseconds */
395
396
    $SOURCE_KEEP_WINDOW = false;	/* Preserve time range when group is changed */
397
    
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
398
79 by Suren A. Chilingaryan
New version of dhtmlxmenu and dhtmlxtree is added
399
    $DHTMLX_SKIN = "standard";
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
400
//    $DHTMLX_SKIN="dhx_blue";
79 by Suren A. Chilingaryan
New version of dhtmlxmenu and dhtmlxtree is added
401
    $DHTMLX_ICONSET = "csh_bluefolders";
1 by Suren A. Chilingaryan
Initial import
402
    $MENU_SHOW_ITEMS = false;		/* Show separate items in popup menu */
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
403
    $MENU_SCROLL_LIMIT = 10;		/* Add scrolling if more than that items present */
1 by Suren A. Chilingaryan
Initial import
404
    
210.1.2 by Suren A. Chilingaryan
Download manager by Aki Rimpelainen
405
    $PHP_BINARY = "/usr/bin/php";
406
    $DOWNLOAD_DECAY_TIME = 72000;       /*  Time after unused download is removed from server*/
407
  
290 by Suren A. Chilingaryan
Limit size of log files unless config option is specified
408
    $JPGRAPH_PATH = "/usr/share/php5/jpgraph";
1 by Suren A. Chilingaryan
Initial import
409
    $EXCEL_WRITER_PATH ="";
24 by Suren A. Chilingaryan
Logger subsystem
410
    $TMP_PATH=$ADEI_ROOTDIR . "tmp";
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
411
412
    $ADEI_ROOT_STORAGE = "$ADEI_ROOTDIR/storage/";
1 by Suren A. Chilingaryan
Initial import
413
    
414
    $ADEI_APP_PATH = array (
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
415
	"default" => "/usr/bin/"
1 by Suren A. Chilingaryan
Initial import
416
    );
417
    
418
    $CSV_SEPARATOR = ",";
419
    $CSV_DATE_FORMAT = "d-M-y H:i:s";
420
    $EXCEL_DATE_FORMAT = "DD.MM.YYYY hh:mm:ss";
421
    $EXCEL_SUBSEC_FORMAT = "DD.MM.YYYY hh:mm:ss.000;@"; /* 
422
	    Unfortunately Excel doesn't support more than 3 digits,
423
	    OpenOffice does */
424
    $ROOT_COMBIHIST_LIMIT = 604800; /* No more, than 1 week */
425
426
14 by Suren A. Chilingaryan
Some minimal information on status bar
427
    $STATUS_DEFAULT_DURATION = 2000;	/* in milliseconds */
428
429
1 by Suren A. Chilingaryan
Initial import
430
    $GRAPH_DEFAULT_HEIGHT = 768; /* in pixels */
431
    $GRAPH_DEFAULT_WIDTH = 1024; /* in pixels */
354.1.11 by Suren A. Chilingaryan
Limit max axes per graph
432
    $GRAPH_MAX_AXES = 6;
1 by Suren A. Chilingaryan
Initial import
433
/* Maximal number of points (all plots) on Graph, this allows us to produce 
434
rough multiplots to sustain high update rate (most of resources are used to 
435
graph->Stroke()) */
436
    $GRAPH_MAX_POINTS_PER_GRAPH = 5000;
437
/* Maximal approximation interval (in pixels). I.e. maximal distance between
438
to approximation points. This option have a priority over MAX_POINTS_PER_GRAPH
439
option. */
440
    $GRAPH_MAX_APPROXIMATION_INTERVAL = 10; /* in pixels */
441
442
    $GRAPH_AUTOAGGREGATION_MINMAX_THRESHOLD = 10; /* in precision, approx. px/2 */
443
444
    $GRAPH_INTERPOLATE_DATA_GAPS = false; /* Do not indicate missing data */
445
446
/* Maximal distance between currently CACHEd data and the data available in the
447
data source, measured in seconds. 0 means - unlimited */
448
    $GRAPH_MAX_CACHE_GAP = 0;
449
11 by Suren A. Chilingaryan
Graph navigation: mouse wheel, modifier keys, etc.
450
    
451
    $GRAPH_ZOOM_RATIO = 2.;	// This coeficent defines product of division of original window by zoomed window
452
    $GRAPH_DEEPZOOM_AREA = 10;	// In pixels (actual interval is 2x)
453
    $GRAPH_STEP_RATIO = 5.;	// This coeficent defines product of division of original window by step
454
    $GRAPH_EDGE_RATIO = 6;	// Product of division of while window by edge size
1 by Suren A. Chilingaryan
Initial import
455
456
    $GRAPH_DELTA_SIZE = 10; /* delta neighborhood size, in pixels */
457
    $GRAPH_MARGINS = array (
115 by Suren A. Chilingaryan
Further drawing improvements: legend, gaps, source tree
458
	"left" => 0,
1 by Suren A. Chilingaryan
Initial import
459
	"top" => 20,
460
	"right" => 20,
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
461
	"bottom" => 30,
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
462
	"axis" => 80
1 by Suren A. Chilingaryan
Initial import
463
    );
464
    $GRAPH_SELECTION = array (
465
	"min_width" => 20,
466
	"min_height" => 20
467
    );
468
469
470
    $GRAPH_LINE_WEIGHT = 2;
471
/* Enables approximation point marks starting with accuracy greater than the
472
specified number of pixels. 0 - to disable. Significatly degradate performance
473
if used */
474
    $GRAPH_ACCURACY_MARKS_OUTSET = 14;
475
    $GRAPH_ACCURACY_MARKS_MULTIOUTSET = 49;
476
    $GRAPH_ACCURACY_MARKS_IF_GAPS = false;	// Force if data gaps are found
477
    $GRAPH_ACCURACY_MARKS_COLOR = "blue";
478
#   $GRAPH_ACCURACY_MARKS_TYPE = MARK_FILLEDCIRCLE;
479
    $GRAPH_ACCURACY_MARKS_SIZE = 3;
480
    
481
/* Display a bar on top of the graph, indicating the density of the data. The
482
four modes are supported:
483
    SHOW_NONE: do not show
484
    SHOW_EMPTY: show only if missing (due to inavalability of the data) points 
485
    are available on the graph
486
    SHOW_POINTS: Indicate all set points on the graph (somehow duplicates 
487
    'GRAPH_ACCURACY_MARKS' functionality, but displayed even if precision is 
488
    high and GRAP_ACCURACY_MARKS are disable by OUTSET
489
    SHOW_GAPS: Will display information on data gaps. Even if point placed on
490
    the graph, but there is less data than expected, all such points will be
491
    indicated on the bar 
492
*/
493
494
    $GRAPH_INDICATE_DATA_DENSITY = 'SHOW_NONE';
11 by Suren A. Chilingaryan
Graph navigation: mouse wheel, modifier keys, etc.
495
//    $GRAPH_INDICATE_DATA_DENSITY = SHOW_POINTS;//SHOW_GAPS;
1 by Suren A. Chilingaryan
Initial import
496
497
    $GRAPH_DENSITY_PLOT_INVALID_SIZE = 3;
498
    $GRAPH_DENSITY_PLOT_INVALID_COLOR = 'red';
499
500
    $GRAPH_DENSITY_PLOT_VALID_SIZE = 0;
501
    $GRAPH_DENSITY_PLOT_VALID_COLOR = 'green';
502
    
503
    $GRAPH_DENSITY_POINTS_TYPE = 'MARK_FILLEDCIRCLE';
504
    $GRAPH_DENSITY_POINTS_SIZE = 1;
505
    $GRAPH_DENSITY_POINTS_COLOR = 'green';
506
    $GRAPH_DENSITY_POINTS_OUTLINE = 'black';
507
    
117 by Suren A. Chilingaryan
Multiple axis support in JavaScript, multiple fixups in source tree handling
508
    $GRAPH_FAST_LEGEND = false;		// Inpricese in rapidly changing data    
138 by Suren A. Chilingaryan
Reuse generated png files in low precision mode (to speedup wiki)
509
510
    $GRAPH_LOWPRECISION_UPDATE_RATE = 10800; // How often we should update low precision graphs
1 by Suren A. Chilingaryan
Initial import
511
    
512
    $GRAPH_SUBSECOND_THRESHOLD = 5;	/* in seconds, for shorter intervals the subsecond handling is performed */
513
514
/* This option defines a plot colors (used sequently), comment out to use black
515
only */
516
    $GRAPH_COLORS =  array("black", "blue", "orange", "brown",
517
	    "#90EE90", "#ADD8E6", "#FFC0CB", "#A020F0", "#1E90FF");
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
518
519
    $AXES_COLORS = array(
520
	array("black"),
521
	array("blue"),
119 by Suren A. Chilingaryan
New way of service handling (mod_rewrite), Various fixups, katrin stuff moved to SETUP directory
522
	array("#f800e9"),
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
523
	array("green"),
119 by Suren A. Chilingaryan
New way of service handling (mod_rewrite), Various fixups, katrin stuff moved to SETUP directory
524
	array("yellow")
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
525
    );
1 by Suren A. Chilingaryan
Initial import
526
/*
527
    $GRAPH_COLORS =  array("black", "#483D8B","#2F4F4F","#00CED1","#9400D3","#FF1493","#00BFFF","#696969","#1E90FF","#D19275","#B22222","#FFFAF0","#228B22","#FF00FF","#DCDCDC",
528
	    "#808080","#008000","#ADFF2F","#F0FFF0","#FF69B4","#CD5C5C","#4B0082","#FFFFF0","#F0E68C","#E6E6FA","#FFF0F5","#7CFC00","#FFFACD","#ADD8E6",
529
	    "#D3D3D3","#90EE90","#FFB6C1","#FFA07A","#20B2AA","#87CEFA","#8470FF","#778899","#B0C4DE","#FFFFE0","#00FF00","#32CD32","#FAF0E6","#FF00FF",
530
	    "#BA55D3","#9370D8","#3CB371","#7B68EE","#00FA9A","#48D1CC","#C71585","#191970","#F5FFFA","#FFE4E1","#FFE4B5","#FFDEAD","#000080","#FDF5E6",
531
	    "#FF4500","#DA70D6","#EEE8AA","#98FB98","#AFEEEE","#D87093","#FFEFD5","#FFDAB9","#CD853F","#FFC0CB","#DDA0DD","#B0E0E6","#800080","#FF0000",
532
	    "#FA8072","#F4A460","#2E8B57","#FFF5EE","#A0522D","#C0C0C0","#87CEEB","#6A5ACD","#708090","#FFFAFA","#00FF7F","#4682B4","#D2B48C","#008080");
533
*/
534
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
535
    if ($ADEI_SETUP)
536
        $SAVED_ADEI_SETUP = $ADEI_SETUP;
537
    else
538
        $SAVED_ADEI_SETUP = false;
539
        
540
    if (getenv("ADEI_SETUP")) {
541
        require("config.env.php");
542
    }
543
    if (file_exists("config.actual.php")) {
544
        require("config.actual.php");
545
    } else {
546
	$ADEI_SETUP = "all";
547
    }
548
    
549
    if ($SAVED_ADEI_SETUP)
550
        $ADEI_SETUP = $SAVED_ADEI_SETUP;
1 by Suren A. Chilingaryan
Initial import
551
552
553
    if ($SETUP_MULTI_MODE) {
554
	if ($_GET['setup']) {
24 by Suren A. Chilingaryan
Logger subsystem
555
	    $ADEI_SETUP = $_GET['setup'];
1 by Suren A. Chilingaryan
Initial import
556
	    unset($_GET['setup']);
557
	} else {
558
	    $params = sizeof($_SERVER['argv']);
559
    	    if ($params>1) {
560
		$pos = array_search("-setup", $_SERVER['argv']);
24 by Suren A. Chilingaryan
Logger subsystem
561
		if (($pos)&&(($pos + 1) < $params)) $ADEI_SETUP =  $_SERVER['argv'][$pos + 1];
1 by Suren A. Chilingaryan
Initial import
562
		else $SETUP_MULTI_MODE = 0;
563
	    } else $SETUP_MULTI_MODE = 0;
564
	}
565
    }
566
398 by Suren A. Chilingaryan
Propogate correct ADEI_SETUP_STRING to JS
567
    $ADEI_SETUP_STRING = $ADEI_SETUP;
568
    
396 by Suren A. Chilingaryan
Introduce ADEI_SETUP_ARGS and support subset option to limit visible data in setup
569
    if (!isset($ADEI_SETUP_ARGS)) {
570
	$ADEI_SETUP_ARGS = array();
571
	
572
	if (preg_match("/^([^\/]+)\/(.*)$/",$ADEI_SETUP, $m)) {
573
	    $ADEI_SETUP = $m[1];
574
	    $ADEI_SETUP_ARGS['subset'] = $m[2];
575
		// we can also parse key:value pairs instead if ':' are in
576
	}
577
    }
578
24 by Suren A. Chilingaryan
Logger subsystem
579
    $SETUP_CONFIG = "setups/$ADEI_SETUP/config.php";
475 by Suren A. Chilingaryan
Further openshift fixes
580
    $SETUP_CSS = "setups/$ADEI_SETUP/config.css";
581
    $LEGACY_SETUP_CSS = "setups/$ADEI_SETUP/$ADEI_SETUP.css";
397 by Suren A. Chilingaryan
Automatically handle subset filtering
582
    
1 by Suren A. Chilingaryan
Initial import
583
    if (!file_exists("config.php")) {
584
        $curdir = getcwd();
23 by Suren A. Chilingaryan
Administrative interface and better handling of missing group channels
585
	if (preg_match("/(services|admin|system|test)$/", $curdir)) chdir("..");
586
	if (!file_exists("config.php")) {
587
	    if (preg_match("/tmp\/admin$/", $curdir)) chdir("..");
588
	}
1 by Suren A. Chilingaryan
Initial import
589
    }
590
    
591
    if (file_exists($SETUP_CONFIG)) require($SETUP_CONFIG);
33 by Suren A. Chilingaryan
Documentation and configuration updates
592
    
593
    if (file_exists("config.override.php")) require("config.override.php");
397 by Suren A. Chilingaryan
Automatically handle subset filtering
594
595
	// The option should be unset in setup if subsetting is handled inside
596
    if (isset($ADEI_SETUP_ARGS['subset'])) {
597
	$subset = $ADEI_SETUP_ARGS['subset'];
412 by Suren A. Chilingaryan
Support multi-server SETUP subsets
598
	foreach (array_keys($READER_DB) as $key) {
599
	    if (!preg_match("/^{$subset}([_\-\\/]|$)/", $key))
600
		unset($READER_DB[$key]);
601
	}
397 by Suren A. Chilingaryan
Automatically handle subset filtering
602
    }
484 by Suren A. Chilingaryan
Group INSERTs into the transactions for better INNODB performance
603
604
    if ($ADEI_CACHE_ENGINE != "INNODB") {
605
	$ADEI_CACHE_COMPRESSION = "None";
606
	$ADEI_TRANSACTION_SIZE = false;
607
    }
608
195 by Suren A. Chilingaryan
Image Export by Arsen Sogomonyan
609
?>