Configurator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 0
dl 0
loc 22
rs 9.7666
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Contact\Common;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 */
14
/**
15
 * Configurator Class
16
 *
17
 * @copyright   XOOPS Project (https://xoops.org)
18
 * @license     https://www.fsf.org/copyleft/gpl.html GNU public license
19
 * @author      XOOPS Development Team
20
 */
21
22
//require_once \dirname(__DIR__, 2) . '/include/common.php';
23
24
/**
25
 * Class Configurator
26
 */
27
class Configurator
28
{
29
    public $name;
30
    public $paths           = [];
31
    public $uploadFolders   = [];
32
    public $copyBlankFiles  = [];
33
    public $copyTestFolders = [];
34
    public $templateFolders = [];
35
    public $oldFiles        = [];
36
    public $oldFolders      = [];
37
    public $renameTables    = [];
38
    public $renameColumns   = [];
39
    public $moduleStats     = [];
40
    public $modCopyright;
41
    public $icons;
42
43
    /**
44
     * Configurator constructor.
45
     */
46
    public function __construct()
47
    {
48
        //        $moduleDirName      = \basename(\dirname(__DIR__, 2));
49
        //        $moduleDirNameUpper =  \mb_strtoupper($moduleDirName);
50
51
        $config = require \dirname(__DIR__, 2) . '/config/config.php';
52
53
        $this->name            = $config->name;
54
        $this->paths           = $config->paths;
55
        $this->uploadFolders   = $config->uploadFolders;
56
        $this->copyBlankFiles  = $config->copyBlankFiles;
57
        $this->copyTestFolders = $config->copyTestFolders;
58
        $this->templateFolders = $config->templateFolders;
59
        $this->oldFiles        = $config->oldFiles;
60
        $this->oldFolders      = $config->oldFolders;
61
        $this->renameTables    = $config->renameTables;
62
        $this->renameColumns   = $config->renameColumns;
63
        $this->moduleStats     = $config->moduleStats;
64
        $this->modCopyright    = $config->modCopyright;
65
66
        $this->icons = require \dirname(__DIR__, 2) . '/config/icons.php';
67
        $this->paths = require \dirname(__DIR__, 2) . '/config/paths.php';
68
    }
69
}
70