1
|
|
|
<?php namespace Xoopsmodules\xsitemap; |
|
|
|
|
2
|
|
|
/* |
3
|
|
|
You may not change or alter any portion of this comment or credits |
4
|
|
|
of supporting developers from this source code or any supporting source code |
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
/** |
12
|
|
|
* Configurator Class |
13
|
|
|
* |
14
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
15
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
16
|
|
|
* @author XOOPS Development Team |
17
|
|
|
* @since 1.00 |
18
|
|
|
* |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
require_once dirname(__DIR__) . '/include/common.php'; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Class Configurator |
25
|
|
|
*/ |
26
|
|
|
class Configurator |
27
|
|
|
{ |
28
|
|
|
public $uploadFolders = []; |
29
|
|
|
public $blankFiles = []; |
30
|
|
|
public $templateFolders = []; |
31
|
|
|
public $oldFiles = []; |
32
|
|
|
public $oldFolders = []; |
33
|
|
|
public $name; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* PublisherConfigurator constructor. |
37
|
|
|
*/ |
38
|
|
|
public function __construct() |
39
|
|
|
{ |
40
|
|
|
$moduleDirName = basename(dirname(__DIR__)); |
41
|
|
|
$capsDirName = strtoupper($moduleDirName); |
42
|
|
|
$this->name = 'Module Configurator'; |
43
|
|
|
$this->uploadFolders = [ |
44
|
|
|
constant($capsDirName . '_UPLOAD_PATH'), |
45
|
|
|
constant($capsDirName . '_UPLOAD_PATH') . '/content', |
46
|
|
|
constant($capsDirName . '_UPLOAD_PATH') . '/images', |
47
|
|
|
constant($capsDirName . '_UPLOAD_PATH') . '/images/category', |
48
|
|
|
constant($capsDirName . '_UPLOAD_PATH') . '/images/thumbnails', |
49
|
|
|
]; |
50
|
|
|
$this->blankFiles = [ |
51
|
|
|
constant($capsDirName . '_UPLOAD_PATH'), |
52
|
|
|
constant($capsDirName . '_UPLOAD_PATH') . '/images/category', |
53
|
|
|
constant($capsDirName . '_UPLOAD_PATH') . '/images/thumbnails', |
54
|
|
|
]; |
55
|
|
|
|
56
|
|
|
$this->templateFolders = [ |
57
|
|
|
'/templates/', |
58
|
|
|
'/templates/blocks/', |
59
|
|
|
'/templates/admin/' |
60
|
|
|
|
61
|
|
|
]; |
62
|
|
|
$this->oldFiles = [ |
63
|
|
|
'/class/request.php', |
64
|
|
|
'/class/registry.php', |
65
|
|
|
'/class/utilities.php', |
66
|
|
|
'/class/util.php', |
67
|
|
|
'/include/constants.php', |
68
|
|
|
'/class/Utility.php', |
69
|
|
|
'/ajaxrating.txt' |
70
|
|
|
]; |
71
|
|
|
$this->oldFolders = [ |
72
|
|
|
'/images', |
73
|
|
|
'/css', |
74
|
|
|
'/js', |
75
|
|
|
'/tcpdf', |
76
|
|
|
]; |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.