Passed
Branch master (30ffcd)
by Michael
06:06
created

Configurator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

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