-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
39 lines (37 loc) · 1.11 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
<?php
require_once(dirname(__FILE__)."/nomo.php");
if(defined('HTTP_AUTH') && HTTP_AUTH==true) include nomo::$frameworkPath."/lib/httpauth/httpauth.php";
try{
//handle AJAX call
if(nomo::$requestURIPathArray[0]=="api"){
include(nomo::$frameworkPath."/api/index.php");
}else if(nomo::$requestURIPathArray[0]=="admin"){
include(nomo::$projectPath."/admin/index.php");
}else{
include(nomo::$projectPath."/frontend-php-website/index.php");
}
}catch(NomoException $e){
$resp=new stdClass;
$resp->ret=$e->getCode();
$scriptfilepath=$e->getFile();
$resp->message=$e->getMessage();
$resp->file=$scriptfilepath;
$resp->line=$e->getLine();
$resp->modified=$modified;
$resp->trace=$e->getTraceAsString();
//TODO fancy 404 page
pre_print_r($resp);
}catch(Exception $e){
$resp=new stdClass;
$resp->ret=5;
$scriptfilepath=$e->getFile();
$resp->message=$e->getMessage();
$resp->reason=$e->getMessage();
$resp->file=$scriptfilepath;
$resp->modified=$modified;
$resp->line=$e->getLine();
$resp->trace=$e->getTraceAsString();
//TODO fancy 404 page
pre_print_r($resp);
}
?>