forked from Samnan/MyWebSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.php
53 lines (43 loc) · 1.4 KB
/
status.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
<?php
/**
* This file is a part of MyWebSQL package
*
* @file: status.php
* @author Samnan ur Rehman
* @copyright (c) 2008-2014 Samnan ur Rehman
* @web http://mywebsql.net
* @license http://mywebsql.net/license
*/
if( defined('MYWEBSQL_COMPACT_DIST') ) {
$files = scandir(BASE_PATH . "/config/");
foreach ($files as $config) {
$_cfn = BASE_PATH.'/mywebsql_config/'. basename($config);
if (file_exists($cfn)) {
Phar::mount('config/'.basename($config), $_cfn);
}
}
}
define('BASE_PATH', dirname(__FILE__));
header("Content-Type: text/html;charset=utf-8");
include_once(BASE_PATH . "/lib/session.php");
Session::init();
include_once(BASE_PATH . "/config/config.php");
if (defined("TRACE_FILEPATH") && TRACE_FILEPATH && defined("TRACE_MESSAGES") && TRACE_MESSAGES)
ini_set("error_log", TRACE_FILEPATH);
$status = '[]';
if ( !isset($_REQUEST['type']) || !isset($_REQUEST['id']) )
die($status);
$module = BASE_PATH . '/modules/'.$_REQUEST['type'].'.php';
if (ctype_alpha($_REQUEST['type']) && file_exists($module)) {
include($module);
if ( function_exists('getModuleStatus') )
$status = json_encode( getModuleStatus($_REQUEST['id']) );
}
/*
* return object should contain the following information
* c = completion ratio
* r = refresh objects ( probably operation complete or db changed )
* s = status flag ( 1=ok, 0=error )
*/
echo $status;
?>