This repository was archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfile_require.php
63 lines (60 loc) · 1.51 KB
/
file_require.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* Bel-CMS [Content management system]
* @version 1.0.0
* @link https://bel-cms.be
* @link https://determe.be
* @license http://opensource.org/licenses/GPL-3.-copyleft
* @copyright 2014-2019 Bel-CMS
* @author as Stive - [email protected]
*/
if (!defined('CHECK_INDEX')) {
header($_SERVER['SERVER_PROTOCOL'] . ' 403 Direct access forbidden');
exit(ERROR_INDEX);
}
final class RequireFiles
{
var $files = array();
function __construct ()
{
$this->files = array(
function_exists('password_hash') ? '' : DIR_CORE.'core.password.php',
DIR_CORE.'core.session.php',
DIR_CORE.'core.dispatcher.php',
DIR_CORE.'core.common.php',
DIR_CORE.'core.host.php',
DIR_CONFIG.'config.inc.php',
DIR_CONFIG.'config.tables.php',
DIR_CORE.'core.spdo.php',
DIR_CORE.'core.config.php',
DIR_CORE.'core.notification.php',
DIR_LANG.'langs.fr.php',
DIR_CORE.'core.secure.php',
DIR_CORE.'core.interaction.php',
DIR_CORE.'core.comment.php',
DIR_CORE.'core.user.php',
DIR_CORE.'core.visitors.php',
DIR_CORE.'core.ban.php',
DIR_CORE.'core.config.page.php',
DIR_CORE.'core.assembly.pages.php',
DIR_CORE.'core.widgets.php',
DIR_CORE.'core.template.php',
DIR_CORE.'core.belcms.php'
);
self::getFiles();
}
private function getFiles ()
{
if (function_exists('password_hash')) {
unset($this->files[0]);
}
foreach ($this->files as $file) {
if (is_file($file)) {
require_once $file;
} else {
throw new Exception ('file '.$file.' not found.');
break;
}
}
}
}