Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Application
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 getNow
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3/**
4 * @package 115Mandant
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsapi;
9
10if (!getenv('ZMS_CONFIG_SECURE_TOKEN')) {
11    throw new \RuntimeException('ZMS_CONFIG_SECURE_TOKEN environment variable must be set');
12}
13
14define('ZMS_CONFIG_SECURE_TOKEN', getenv('ZMS_CONFIG_SECURE_TOKEN'));
15
16class Application extends \BO\Slim\Application
17{
18    /**
19     * Name of the application
20     */
21    const IDENTIFIER = 'zms';
22
23    const MODULE_NAME = 'zmsapi';
24
25    /**
26     * @var Bool DEBUG
27     */
28    const DEBUG = false;
29
30    /**
31     * @var Bool DB_ENABLE_WSREPSYNCWAIT
32     */
33    const DB_ENABLE_WSREPSYNCWAIT = false;
34
35    /**
36     * @var Bool RIGHTSCHECK_ENABLED
37     */
38    const RIGHTSCHECK_ENABLED = true;
39
40    /**
41     * @var String DB_DSN_READONLY
42     */
43    const DB_DSN_READONLY = 'mysql:dbname=zmsbo;host=127.0.0.1';
44
45    /**
46     * @var String DB_DSN_READWRITE
47     */
48    const DB_DSN_READWRITE = 'mysql:dbname=zmsbo;host=127.0.0.1';
49
50    /**
51     * temporary db name for using dldb data
52     * @var String DB_STARTINFO
53     */
54    const DB_STARTINFO = 'startinfo';
55
56    /**
57     * @var String DB_USERNAME
58     */
59    const DB_USERNAME = 'server';
60
61    /**
62     * @var String DB_PASSWORD
63     */
64    const DB_PASSWORD = 'internet';
65
66    /**
67     * @var String DB_IS_GALERA
68     */
69    const DB_IS_GALERA = true;
70
71    /**
72     * @var String Security Token for Api Access -> get config for example
73     */
74    const SECURE_TOKEN = ZMS_CONFIG_SECURE_TOKEN;
75
76    /**
77     * language preferences
78     */
79
80    public static $locale = 'de';
81
82    public static $supportedLanguages = array(
83        // Default language
84        'de' => array(
85            'name'    => 'Deutsch',
86            'locale'  => 'de_DE.utf-8',
87            'default' => true,
88        )
89    );
90
91    /**
92     * dldb data path
93     */
94    public static $data = '/data';
95
96    /**
97     * @var \DateTimeInterface $now time to use for today (testing)
98     */
99    public static $now = null;
100
101    public static function getNow()
102    {
103        if (self::$now instanceof \DateTimeInterface) {
104            return self::$now;
105        }
106        return new \DateTimeImmutable();
107    }
108}