-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoloader.php
48 lines (33 loc) · 1013 Bytes
/
autoloader.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
<?php
/**
* Created by PhpStorm.
* User: Arthur
* Date: 22/04/2015
* Time: 13:44
*/
session_start();
define( 'ABSPATH', dirname(__FILE__) );
include_once (ABSPATH.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'_connect.php');
include_once ABSPATH . '\conf\_connect.php';
var_dump($_REQUEST);
var_dump($_FILES);
/* Creation de la fonction autoloader */
function my_autoloader($className) {
echo '<pre>Autoload : ' . $className;
$path = CLASS_DIR . '\\' . $className.'.php';
echo "\n => $path</pre>";
require $path;
include CLASS_DIR.$className.'.php';
}
spl_autoload_register('my_autoloader');
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_STRIPPED);
$option = filter_input(INPUT_GET, 'opt', FILTER_SANITIZE_STRIPPED);
if(file_exists(MODELE_DIR.'/'.$page.'.php')) {
include_once (MODELE_DIR.'/'.$page.'.php');
if($vue != '') {
include_once VIEW_DIR.'\page'.'.php';
}
} else {
$vue = 'default';
include_once VIEW_DIR . '\page.php';
}