-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
73 lines (59 loc) · 1.84 KB
/
index.php
File metadata and controls
73 lines (59 loc) · 1.84 KB
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
<?php
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
*
* This can be set to anything, but default usage is:
*
* development
* production
*
* NOTE: If you change these, also change the error_reporting() code below
*
*/
session_start();
define('ENVIRONMENT', 'development');
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
$system_path = 'system';
$application_folder = 'application';
define('APPPATH' , dirname(__FILE__) . DIRECTORY_SEPARATOR . $application_folder . DIRECTORY_SEPARATOR);
define('SYSPATH' , dirname(__FILE__) . DIRECTORY_SEPARATOR . $system_path . DIRECTORY_SEPARATOR);
foreach(glob(SYSPATH . DIRECTORY_SEPARATOR . "lib" . DIRECTORY_SEPARATOR . "*.php") as $file){
require_once($file);
}
require(APPPATH . 'config' . DIRECTORY_SEPARATOR . 'config.php');
foreach(glob(SYSPATH . DIRECTORY_SEPARATOR . "*.php") as $file){
@require_once($file);
}
$app = new VF_App($config);
$dirs = array('hooks', 'models', 'controllers', 'routers');
foreach($dirs as $ac){
foreach(glob(SYSPATH . DIRECTORY_SEPARATOR . $ac . DIRECTORY_SEPARATOR . "*.php") as $file){
require_once($file);
}
}
foreach($dirs as $ac){
foreach(glob(APPPATH . DIRECTORY_SEPARATOR . $ac . DIRECTORY_SEPARATOR . "*.php") as $file){
require_once($file);
}
}
$app->run();