-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoload.php
50 lines (44 loc) · 1.29 KB
/
autoload.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
<?php
function autoloadModels($className)
{
$filename = "../models/" . $className . ".php";
if (is_readable($filename)) {
include_once $filename;
}
}
function autoloadControllers($className)
{
$filename = "../controllers/" . $className . ".php";
if (is_readable($filename)) {
include_once $filename;
}
}
function autoloadCore($className)
{
$filename = "../core/" . $className . ".php";
if (is_readable($filename)) {
include_once $filename;
}
}
function autoloadRepository($className)
{
$filename = "../core/repository/" . $className . ".php";
if (is_readable($filename)) {
include_once $filename;
}
}
function autoloadServices($className)
{
$filename = "../services/" . $className . ".php";
if (is_readable($filename)) {
include_once $filename;
}
}
spl_autoload_register("autoloadCore");
spl_autoload_register("autoloadRepository");
spl_autoload_register("autoloadModels");
spl_autoload_register("autoloadControllers");
spl_autoload_register("autoloadServices");
// add autoloads from modules
include_once "modules/authentification/autoload.php";
?>