config.inc.php 1.59 KB
Newer Older
1 2
<?php

Peter Tönnies's avatar
Peter Tönnies committed
3
$FS_ENV = getenv('FS_ENV');
4
$env_filename = __DIR__ . '/config.inc.' . $FS_ENV . '.php';
5 6 7 8 9 10 11
if (defined('FS_ENV')) {
	if (FS_ENV !== $FS_ENV) {
		die('different values of FS_ENV const (' . FS_ENV . ') and ENV var (' . $FS_ENV . ')');
	}
} else {
	define('FS_ENV', $FS_ENV);
}
12 13 14 15

if (file_exists($env_filename)) {
	require_once $env_filename;
} else {
Peter Tönnies's avatar
Peter Tönnies committed
16
	die('no config found for env [' . $FS_ENV . ']');
17
}
Peter Tönnies's avatar
Peter Tönnies committed
18
if (!defined('SOCK_URL')) {
19
	define('SOCK_URL', 'http://127.0.0.1:1338/');
20
}
21

22
date_default_timezone_set('Europe/Berlin');
Matthias Larisch's avatar
Matthias Larisch committed
23
locale_set_default('de-DE');
24 25 26 27
/*
 * Read revision from revision file.
 * It is supposed to define SRC_REVISION.
 */
28 29 30
$revision_filename = __DIR__ . '/revision.inc.php';
if (file_exists($revision_filename)) {
	require_once $revision_filename;
31
}
32 33 34 35 36 37 38 39

/*
 * Configure Raven (sentry.io client) for remote error reporting
 */
if (defined('SENTRY_URL')) {
	$client = new Raven_Client(SENTRY_URL);
	$client->install();
	$client->tags_context(array('FS_ENV' => $FS_ENV));
40 41 42
	if (defined('SRC_REVISION')) {
		$client->setRelease(SRC_REVISION);
	}
43
}
44

45 46 47 48
if (!defined('RAVEN_JAVASCRIPT_CONFIG') && getenv('RAVEN_JAVASCRIPT_CONFIG')) {
	define('RAVEN_JAVASCRIPT_CONFIG', getenv('RAVEN_JAVASCRIPT_CONFIG'));
}

49 50 51 52
if (!defined('CSP_REPORT_ONLY')) {
	define('CSP_REPORT_ONLY', true);
}

53
define('FPDF_FONTPATH', __DIR__ . '/lib/font/');
54

55
/* global definitions for Foodsharing\\Helpers\\PageHelper*/
56 57 58 59 60 61
define('CNT_MAIN', 0);
define('CNT_RIGHT', 1);
define('CNT_TOP', 2);
define('CNT_BOTTOM', 3);
define('CNT_LEFT', 4);
define('CNT_OVERTOP', 5);
Matthias Larisch's avatar
Matthias Larisch committed
62

63
define('DSN', 'mysql:host=' . DB_HOST . ';dbname=' . DB_DB . ';charset=utf8mb4');