Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
n/a
0 / 0
CRAP
n/a
0 / 0
Application
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3/**
4 *
5 * @package Zmscalldisplay
6 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
7 *
8 */
9
10namespace BO\Zmscalldisplay;
11
12if (($token = getenv('ZMS_CONFIG_SECURE_TOKEN')) === false || $token === '') {
13    throw new \RuntimeException('ZMS_CONFIG_SECURE_TOKEN environment variable must be set');
14}
15
16define('ZMS_CONFIG_SECURE_TOKEN', getenv('ZMS_CONFIG_SECURE_TOKEN'));
17
18if (!defined('ZMS_CALLDISPLAY_TWIG_CACHE')) {
19    $value = getenv('ZMS_CALLDISPLAY_TWIG_CACHE');
20    define('ZMS_CALLDISPLAY_TWIG_CACHE', ($value === 'false') ? false : ($value ?: '/cache/'));
21}
22
23class Application extends \BO\Slim\Application
24{
25    /**
26     * Name of the application
27     */
28    const IDENTIFIER = 'zms';
29    const MODULE_NAME = 'zmscalldisplay';
30    const DEBUG = false;
31    const TWIG_CACHE = ZMS_CALLDISPLAY_TWIG_CACHE;
32
33    /**
34     * language preferences
35     */
36    public static $locale = 'de';
37
38    public static $supportedLanguages = array(
39        // Default language
40        'de' => array(
41            'name'    => 'Deutsch',
42            'locale'  => 'de_DE.utf-8',
43            'default' => true,
44        ),
45        'en' => array(
46            'name'    => 'English',
47            'locale'  => 'en_GB.utf-8',
48            'default' => false,
49        )
50    );
51
52    public static $now = '';
53
54    /*
55     * -----------------------------------------------------------------------
56     * ZMS API access
57     */
58
59    public static $http = null;
60
61    public static $http_curl_config = array();
62
63    const JSON_COMPRESS_LEVEL = 1;
64
65    /**
66     * HTTP url for api
67     */
68    const HTTP_BASE_URL = 'http://user:pass@host.tdl';
69    const SECURE_TOKEN = ZMS_CONFIG_SECURE_TOKEN;
70
71     /**
72     * signature key for url signature to save query paramter with hash
73     */
74    public static $urlSignatureSecret = ZMS_CONFIG_SECURE_TOKEN;
75}