-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
47 lines (40 loc) · 1.41 KB
/
index.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
<?php
// Decomment for debug
// error_reporting(-1); // Report all PHP errors
// ini_set('error_reporting', -1); // -1 is E_ALL
// ini_set('display_errors', 1); // Show all PHP errors
define('MBT_DOCUMENT_ROOT', __DIR__);
require_once './autoload/src/Loader.php';
// require_once __DIR__ . '/vendor/autoload.php';
new \Aautoloder\Loader(array(MBT_DOCUMENT_ROOT));
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Prod3v3loper - Autoload</title>
</head>
<body>
<h1>Loaded classes</h1>
<p>Reload the page to see the load time. And deactivate the autoload debug in <code>src/core.config.php</code></p>
<code>define('MBT_DEBUG_DISPLAY_AUTOLOAD', true);</code>
<br><br>
<?php
// METHOD 1: Fastest way, the namespace is foldername structure and filename is equal to filename
$first_class = new testclasses\first_class();
$first_class->method_from_first_class();
?>
<br><br>
<?php
// METHOD 2: The slower way, namespace is equal to folder structure but the classname is differnt to the filename
$second_class = new testclasses\classes\second_class();
$second_class->method_from_second_class();
?>
<br><br>
<?php
// METHOD 3: The slowest way, here ist nothing euqal with the namespace (folder) and classname (filename)
$third_class = new name_space\namespace2\third_class();
$third_class->method_from_third_class();
?>
</body>
</html>