Passed
Push — 1.11.x ( e4e88c...b4241a )
by Yannick
09:32 queued 16s
created

AppConfig::GetDemoParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * (c) Copyright Ascensio System SIA 2023
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 *
18
 */
19
20
require_once __DIR__ . "/../../../main/inc/global.inc.php";
21
22
class AppConfig {
23
24
    /**
25
     * The config key for the jwt header
26
     *
27
     * @var string
28
     */
29
    private const jwtHeader = "onlyoffice_jwt_header";
30
31
    /**
32
     * The config key for the internal url
33
     *
34
     * @var string
35
     */
36
    private const internalUrl = "onlyoffice_internal_url";
37
38
    /**
39
    * Link to Docs Cloud
40
    *
41
    * @var string
42
    */
43
    private const linkToDocs = "https://www.onlyoffice.com/docs-registration.aspx?referer=chamilo";
44
45
    /**
46
     * The config key for the storage url
47
     *
48
     * @var string
49
     */
50
    private const storageUrl = "onlyoffice_storage_url";
51
52
    /**
53
     * Get the jwt header setting
54
     *
55
     * @return string
56
     */
57
    public static function JwtHeader()
58
    {
59
        $header = api_get_configuration_value(self::jwtHeader);
60
        return $header;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $header also could return the type boolean which is incompatible with the documented return type string.
Loading history...
61
    }
62
63
    /**
64
     * Get the internal url setting
65
     *
66
     * @return string
67
     */
68
    public static function InternalUrl()
69
    {
70
        $internalUrl = api_get_configuration_value(self::internalUrl);
71
        return $internalUrl;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $internalUrl also could return the type boolean which is incompatible with the documented return type string.
Loading history...
72
    }
73
74
    /**
75
     * Get the storage url setting
76
     *
77
     * @return string
78
     */
79
    public static function StorageUrl()
80
    {
81
        $storageUrl = api_get_configuration_value(self::storageUrl);
82
        return $storageUrl;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $storageUrl also could return the type boolean which is incompatible with the documented return type string.
Loading history...
83
    }
84
85
    /**
86
     * DEMO DATA
87
     */
88
    private const DEMO_PARAM = [
89
        "ADDR" => "https://onlinedocs.onlyoffice.com/",
90
        "HEADER" => "AuthorizationJWT",
91
        "SECRET" => "sn2puSUF7muF5Jas",
92
        "TRIAL" => 30
93
    ];
94
95
    /**
96
     * Get demo params
97
     *
98
     * @return array
99
     */
100
    public static function GetDemoParams()
101
    {
102
        return self::DEMO_PARAM;
103
    }
104
105
    /**
106
    * Get link to Docs Cloud
107
    *
108
    * @return string
109
    */
110
    public function GetLinkToDocs() {
111
        return self::linkToDocs;
112
    }
113
}
114