-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathloader.inc.php
43 lines (37 loc) · 1.31 KB
/
loader.inc.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
<?php
/**
* @copyright 2019-2020 RactPanel Project (http://www.ractpanel.ractbd.com/)
* RactPanel is a GPL fork of the Sentora Project whose original header follows:
*
* Module loader script for detecting and displaying the correct module using the Dryden framework, this handles the autolaoding of classes.
* @package zpanelx
* @subpackage dryden -> core
* @author Bobby Allen (ballen@bobbyallen.me)
* @copyright ZPanel Project (http://www.zpanelcp.com/)
* @link http://www.zpanelcp.com/
* @license GPL (http://www.gnu.org/licenses/gpl.html)
*/
global $starttime;
$mtime = explode(' ', microtime());
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
$class_name = null;
function __autoload($class_name)
{
$path = 'dryden/' . str_replace('_', '/', $class_name) . '.class.php';
if (file_exists($path)) {
require_once $path;
}
}
spl_autoload_register('__autoload');
if (isset($_GET['module'])) {
$CleanModuleName = fs_protector::SanitiseFolderName($_GET['module']);
$ControlerPath = 'modules/' . $CleanModuleName . '/code/controller.ext.php';
if (file_exists($ControlerPath)) {
require_once $ControlerPath;
}
$ModulePath = 'modules/' . $CleanModuleName . '/code/' . $class_name . '.class.php';
if (file_exists($ModulePath)) {
require_once $ModulePath;
}
}