-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
86 lines (76 loc) · 2.27 KB
/
index.php
File metadata and controls
86 lines (76 loc) · 2.27 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
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/**
* Nimbus - Manage, Share & Collaborate
*
* Nimbus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* see LICENSE for more Copyright goodness.
*
* @package: Nimbus
* @copyright: 2009-2010, Nimbus Dev Group, All rights reserved.
* @license: GNU/GPLv3, see LICENSE
* @version: 1.0.0 Alpha
*/
//Set flag as parent file
define('NIMBUSEXEC', 1);
require_once 'config.php';
//Set error reporting via the debug constant
if (NIMBUS_DEBUG === 1) {
error_reporting(E_ERROR);
} elseif (NIMBUS_DEBUG === 2) {
error_reporting(E_ALL);
} else {
error_reporting(0);
}
//Set utf8 compatibility
require_once LIBRARY_DIR . 'utf8.php';
ini_set('default_charset', 'UTF-8');
nUtf8::load();
//Check if the installer is present, or if it is installed
if (!file_exists('config.php') &&
file_exists('installer' . DS . 'index.php')) {
header('Location: installer/index.php');
}
//Include the bootstrap files
require_once NIMBUS_DIR . 'bootstrap.php';
require_once NIMBUS_DIR . 'common.php';
//Instantiate the front controller abstraction of the kernel
$app = new Nimbus();
$app->init();
//Get the time nimbus started
$app->benchmark('app', START);
//Check if nimbus is being called for a request
if ($app->beingCalled()) {
switch ($app->request->type) {
//Request identifiers are prefixed with an underscore ( _ ) to avoid variable collision.
case "app": //Internal function call to applications
Loader::system('application');
Application::launch();
break;
case "res": //Internal/External resource loader
Loader::system('resource');
new Resource();
break;
case "token": //Generate an access token
new Token(true);
break;
case "rpc": //RPC capabilities
$app->RPC->listen();
break;
case "service": //Load services
$app->service($app->request->get['service']);
break;
case "data": //Raw SQL Query for JS uses, of course, checks for Access Token to prevent abuse
Loader::system('query');
new Query();
break;
}
} else {
//Generate the base HTML canvas
$app->canvas();
}
//Get the time nimbus stopped, and echo out if allowed
$app->benchmark('app', STOP, NIMBUS_DEBUG);
?>