-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
85 lines (66 loc) · 2.2 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
//globals
define("global_path", __DIR__ . "/");
define("render_template", global_path . "app/views/");
define("render_partial", global_path . "app/views/partials/");
define("stylesheet_tag", global_path . "app/assets/css/");
define("javascript_include", global_path . "app/assets/js/");
define("include_vendor", global_path . "vendor/");
define("include_lib", global_path . "lib/");
define("include_model", global_path . "app/models/");
define("include_controller", global_path . "app/controllers/");
//add dependencies
define("FACEBOOK_SDK_V4_SRC_DIR", "./vendor/facebook-php-sdk-v4.4.0-dev/src/Facebook/");
//
session_start();
//add autoload.php
require global_path . "autoload.php";
// router
$router = new AltoRouter();
$data = array(
'helper' => $helper,
'scopes' => $application['general']['facebook']['scopes']
);
;
$router->map('GET', '/', $HomeController->index($data));
$match = $router->match();
if( $match && is_callable( $match['target'] ) ) {
call_user_func_array( $match['target'], $match['params'] );
} else {
// no route was matched
header( $_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
}
/**$uri = $_SERVER['REQUEST_URI'];
if($uri == "/" || $uri == "/index.php"):
$data = array(
'helper' => $helper,
'scopes' => $application['general']['facebook']['scopes']
);
$HomeController->index($data);
elseif(ereg("/login", $uri)):
$HomeController->login();
elseif(ereg("/LineasTematicas/EducacionDesarrollo", $uri)):
$TematicLinesController->education();
endif; */
/**switch($uri)
{
case "/":
$data = array(
'helper' => $helper,
'scopes' => $application['general']['facebook']['scopes']
);
$HomeController->index($data);
break;
case "/index.php":
$data = array(
'helper' => $helper,
'scopes' => $application['general']['facebook']['scopes']
);
$HomeController->index();
break;
case "/login\*":
default:
echo "no nada de que";
break;
}*/
?>